Re: Zip Code Fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



you can store it as an integer, but make sure you use a proper print function 
to display it later that preserves the 5 digits, such as: 


 echo str_pad($zip, 5, "0", STR_PAD_LEFT);


or something like that.. I take it you have no plans to store 10 digit zips? 

-Micah 
 


On Wednesday 08 September 2004 08:36 am, Aaron Todd wrote:
> Just curious, but what kind of field is everyone using to store a Zip Code.
> I set mine to Medium Integer with a max of 5 digits, but for zip codes that
> begins with 0 the 0 is knocked off.  The only solutiuon I can think of is
> to make the field a text field.  Does anyone have a better solution?
>
> Thanks,
>
> Aaron

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux