ohitsme Posted November 24, 2008 Share Posted November 24, 2008 Hi, if i make a field with int(10) what does that mean? 10 bytes? whats the biggest number int(10) could hold? 2^10? (1024)? thanks a lot Quote Link to comment Share on other sites More sharing options...
xtopolis Posted November 24, 2008 Share Posted November 24, 2008 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. Quote Link to comment Share on other sites More sharing options...
corbin Posted November 24, 2008 Share Posted November 24, 2008 Yeah I came across that page a while back, and thought the same thing you did. "Wait, it doesn't even matter? Oh...." lol From then forward, I've always used just INT unless I need to zerofill a column. Quote Link to comment Share on other sites More sharing options...
ohitsme Posted November 24, 2008 Author Share Posted November 24, 2008 Lol, didn't think it would be that... i did wonder why you didn't need to always put a length value for int... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.