As I SET
cust_fax in a table in MySQL like this:
cust_fax integer(10) NOT NULL,
and then I insert value like this:
INSERT INTO database values ('3172978990');
but then it say
`error 1264` out of value for column
And I want to know where the error is? My set? Or other?
Any answer will be appreciated!
Use unsigned. int = from 0 to 4294967295
or VARCHAR
You can also change the data type to bigInt and it will solve your problem, it's not a good practice to keep integers as strings unless needed. :)
The integer 3172978990 is greater than 2147483647, hence the error**.
To fix the error, change your datatype to
VARCHAR
. Phone, Fax etc. should be stored as strings. See this discussion.** Here is a chart that tells you which integer type can store what values.
You are exceeding the length of int datatype. You can use UNSIGNED attribute to support that value.
SIGNED INT can support till 2147483647 and with UNSIGNED INT allows double than this. After this you still want to save data than use CHAR or VARCHAR with length 10