[ciapug] MySQL table data - "1" and "01" different values

Lathrop Preston ciapug@cialug.org
Tue, 06 Apr 2004 10:49:59 -0500


> I had been using SMALLINT but it drops leading zeros as well.

any numeric type
SMALLINT
INT
FLOAT
etc.
will drop leading zeros, this has nothing to do with it being mySQL, if 
you use a numeric type in _any_ DB or language you will not have leading 
zeros.

if you are dealing with car numbers
is is a static length value ie ( all numbers will be 5 characters long?)

if so str_pad() will still work.

Lathrop