I'm using PhpMyAdmin
to set my table structures.
As I'm learning to use the columns correctly, I'm curious about choosing the right integer
type, and most importantly the Length (phpmyadmin
requires it)
From the DZone.com I've read this:
Field Type Breakdown INT 0 to 4,294,967,295 TINYINT 0 to 255 SMALLINT 0 to 65535 MEDIUMINT 0 to 16,777,215 BIGINT 0 to 18,446,744,073,709,551,615
And that helps me decide which integer
type I'm most likely to use.
From the chart, I believe I need the SMALLINT, as I need more than 255.
But as I prepare it in phpmyadmin
, I'm required to enter a Length/Value.
If I'm sure my ID's won't get higher than 3000, do I put the number 4 in the Length/Value box?
its called the display size. The actual length of the values are not changed in any way so an int of length 5 and an int with no length will take up the same space.
the 4 will accept the values of 4 integers so it can be 4 yes. the values will be accepted till 9999
this can help you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With