Re: Zip Code Fields

From: Date: Wed, 08 Sep 2004 18:34:29 +0000
Subject: Re: Zip Code Fields
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-36114@lists.php.net to get a copy of this message
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

« previous php.db (#36114) next »