greenace92 Posted November 20, 2015 Share Posted November 20, 2015 I usually set an ID to 13, does that mean 9999999999999 ? I say 9 as in 0 to 9, I read the manual saying INT 4 -2147483648 2147483647 I don't see how that relates, or is it like 2^13 when I specify 13? Quote Link to comment https://forums.phpfreaks.com/topic/299538-when-you-specify-an-int-length-in-mysql-what-does-it-mean/ Share on other sites More sharing options...
Barand Posted November 20, 2015 Share Posted November 20, 2015 http://dev.mysql.com/doc/refman/5.6/en/numeric-type-attributes.html Quote Link to comment https://forums.phpfreaks.com/topic/299538-when-you-specify-an-int-length-in-mysql-what-does-it-mean/#findComment-1526859 Share on other sites More sharing options...
Jacques1 Posted November 21, 2015 Share Posted November 21, 2015 The short version: The display width is irrelevant except for very special cases (like when you use ZEROFILL to pad your numbers with leading zeros). Quote Link to comment https://forums.phpfreaks.com/topic/299538-when-you-specify-an-int-length-in-mysql-what-does-it-mean/#findComment-1526870 Share on other sites More sharing options...
greenace92 Posted November 21, 2015 Author Share Posted November 21, 2015 (edited) Ahh there it is second sentence: MySQL supports an extension for optionally specifying the display width of integer data types in parentheses following the base keyword for the type. For example, INT(4) specifies an INT with a display width of four digits. Assuming that Int(4) translates to Int length 4 as seen in phpmyadmin Edited November 21, 2015 by greenace92 Quote Link to comment https://forums.phpfreaks.com/topic/299538-when-you-specify-an-int-length-in-mysql-what-does-it-mean/#findComment-1526879 Share on other sites More sharing options...
Jacques1 Posted November 21, 2015 Share Posted November 21, 2015 Yeah, but do you understand what “length” actually means in this context? It's irrelevant for you (if it was relevant, you'd know). Quote Link to comment https://forums.phpfreaks.com/topic/299538-when-you-specify-an-int-length-in-mysql-what-does-it-mean/#findComment-1526884 Share on other sites More sharing options...
greenace92 Posted November 27, 2015 Author Share Posted November 27, 2015 (edited) Yeah, but do you understand what “length” actually means in this context? It's irrelevant for you (if it was relevant, you'd know). I guess I don't based on what you have written, I thought I did. Edited November 27, 2015 by greenace92 Quote Link to comment https://forums.phpfreaks.com/topic/299538-when-you-specify-an-int-length-in-mysql-what-does-it-mean/#findComment-1527233 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.