IN Mysql :
INT(1) = 2147483647
and Store 4 byte,
then what about INT(2) = ?
and Store ?
byte...
I used in INT(1) more than 2147483647 it does not work ! also I used in INT(2) with same value it does not work ?? Why ?
Solution ?
IN Mysql :
INT(1) = 2147483647
and Store 4 byte,
then what about INT(2) = ?
and Store ?
byte...
I used in INT(1) more than 2147483647 it does not work ! also I used in INT(2) with same value it does not work ?? Why ?
Solution ?
The optional display width specifier is only applicable when using zerofill and has nothing to do with the internal size (in bytes) of the integer data type. It is always 4 bytes.
This optional display width may be used by applications to display integer values having a width less than the width specified for the column by left-padding them with spaces. (That is, this width is present in the metadata returned with result sets. Whether it is used or not is up to the application.)
Here's [a link] (http://dev.mysql.com/doc/refman/5.5/en/numeric-type-attributes.html)
Example For More
drop table if exists tablename;
create table tablename ( columnname int(4) unsigned zerofill not null default 0 );
insert into tablename (columnname) values (123),(456),(1234);
select * from tablename;
OutPut
0123
0456
1234
The parenthesised number represents the number of digits returned by the field. You can insert any number into an INT(1), but you will only get out a number between 0 and 9.
INT in MySQL is always 4-byte number.
The syntax of INT type is INT(M), where M indicates the maximum display width; but not all MySQL clients supports this value.
You should use a BIGINT to get 8 bytes (See Integer Types). The number in parentesis indicates only the maximum display width (See Numeric Type Attributes)