|
And zerofill is, in my opinion, a bad idea.
It gives the mistaken impression that MySQL is actually storing numbers with leading zeroes.
Nothing could be further from the truth!
INTERNALLY, there is NO DIFFERENCE between TINYINT(0) and TINYINT(50).
The *ONLY* difference is that, when you SELECT a field declared as TINYINT(50) ZEROFILL, MySQL must convert the *NUMBER* in the field to a *STRING*! Because ONLY strings can actually have zero fill.
On top of all that, when you USE a ZEROFILL field in a server-side language, such as PHP or ASP or JSP, you many be surprised at what the actual value is.
At least in ASP, for example, the zero fill is *REMOVED* from the number and the number is treated as a DOUBLE (a.k.a. REAL) number, not as an integer, at all.
So the best thing you can do, in my opinion, is *NEVER* use ZEROFILL.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
|