Mateobus Posted August 8, 2006 Share Posted August 8, 2006 I thought that in a MyISAM table, if i use an int type and specify a length of 4, it will allow values up to 9999. This is wrong apparently as the table only help up to 127. So what is this length based on? How big will an int of length 10 hold?3? Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/16848-mysql-int-data-type/ Share on other sites More sharing options...
Barand Posted August 8, 2006 Share Posted August 8, 2006 Have you used INT or TINYINT? Quote Link to comment https://forums.phpfreaks.com/topic/16848-mysql-int-data-type/#findComment-70984 Share on other sites More sharing options...
wildteen88 Posted August 8, 2006 Share Posted August 8, 2006 When you specifiy the length it means the length of the number, so if its 4 it'll accept upto a 4 digit number, where as 10 will allows upto a 10 digit number. Quote Link to comment https://forums.phpfreaks.com/topic/16848-mysql-int-data-type/#findComment-71111 Share on other sites More sharing options...
Mateobus Posted August 8, 2006 Author Share Posted August 8, 2006 I did tinyint (4). Is this unacceptable? Quote Link to comment https://forums.phpfreaks.com/topic/16848-mysql-int-data-type/#findComment-71130 Share on other sites More sharing options...
wildteen88 Posted August 8, 2006 Share Posted August 8, 2006 No. Tinyint can only hold an Integer that is between -128 and 127 when it is signed. If its unsigned it can hold an integer between 0 and 255Have a look at the Data Types column in this [url=http://www.ilovejackdaniels.com/mysql_cheat_sheet.png]cheat sheat[/url] to see what each data type can hold Quote Link to comment https://forums.phpfreaks.com/topic/16848-mysql-int-data-type/#findComment-71139 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.