I am too much confused in Length/Values column in phpmyadmin.
Can any one explain me, What is the difference between int(1) and int(2)?
I am too much confused in Length/Values column in phpmyadmin.
Can any one explain me, What is the difference between int(1) and int(2)?
Its called display width, It will take a whole int, but only will display the first x numbers (so 1 will display 1 number, 2 will display 2)
The whole int is stored so its not like varchar, IF you want less storage use a smaller type (tinyint would suffice for both 1 and 2)
The types and how much they can store are here
I believe that is the "width" or size of your number. int(2) means that it can be two digits, and int(3) means three digits, so on and so forth. I could be wrong, but let me know if this answers your question!
I know it works this way for varchar(n), so I'm thinking it's the same for int(n).