Forum Moderators: coopster
With PHP or Perl have a look at the printf and sprintf functions.
You could define the column with the optional extension attribute
ZEROFILLand then the default padding of spaces is replaced with zeros. For example, for a column declared as TINYINT ZEROFILL, a value of 7 is retrieved as 007.
Note however that it is unnecessary to define the
UNSIGNEDattribute if you specify
ZEROFILLfor a numeric column as MySQL automatically adds the
UNSIGNEDattribute for you.