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

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -