as all you know, when you describe varchar or integer fields you should set the length of them...
something like int(5) or varchar(5)...
but when you try add 123456 to both fields.. while varchar field truncates the value, integer field does not truncate it...
so what's the aim of describing int length?
int(5)
does not do what you think it does: it specifies an integer field with a display width of 5 digits, i.e. numbers shorter than 5 digits will be padded with space characters.
In MySQL, int
values are always 4 bytes wide and can go from -2,147,483,648 to 2,147,483,647.
See http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With