php - Zip Code missing leading 0 when retrieved from mySQL tables -


i storing 5 digit zip codes in mysql tables char(5). when zip code leading zeroes (ie. 02138) retrieved tables, becomes 2138. since being stored in tables 02138 (checked phpmyadmin), has php stripping off leading 0? how can make sure retain leading 0?

i'm using quite long sql query string using activerecords in codeigniter.

foreach($q $row){         /// bunch of code adds more elements $row array          $data['rows'][] = $row;     } 

str_pad($zip, 5, 0, str_pad_left); 

Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -