Jump to content

what does the value for int(x) represent


ohitsme

Recommended Posts

http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html

 

Apparently it only affects the display width of the column.

Another extension is supported by MySQL for optionally specifying the display width of integer data types in parentheses following the base keyword for the type (for example, INT(4)). 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.)

For example, for a column declared as INT(5) ZEROFILL, a value of 4 is retrieved as 00004.

 

I always default to INT(11) for my int types, didn't even know what I was doing lol.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.