RE: [PHP-DB] Zip Code Fields
Doesn't the USPS have some online API for checking Zip Codes? Not sure but I thought I read about it somewhere. look here http://www.usps.com/webtools/ -Original Message- From: Justin Palmer <[EMAIL PROTECTED]> Sent: Sep 8, 2004 12:25 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Zip Code Fields Are you only accepting US zip codes? Justin -Original Message- From: Aaron Todd [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 8:36 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Zip Code Fields 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php D B DDD DD BBB BB DDD DD JJJ BBB BB DDD DD JJJ BBB BB DDDDDJJJ B DDD DD JJ JJJ BBB BB DDD DD JJ JJJ BBB BB DDD DD ..JJ ..BBB BB D .. ..B --- Dylan Barber (CIW Professional, A+ Technician) Web Designer / Developer / DotNetNuke Portal Creator --- Clip those URLs! - Short links are easier to remember. http://clipurl.com D B DDD DD BBB BB DDD DD JJJ BBB BB DDD DD JJJ BBB BB DDDDDJJJ B DDD DD JJ JJJ BBB BB DDD DD JJ JJJ BBB BB DDD DD ..JJ ..BBB BB D .. ..B --- Dylan Barber (CIW Professional, A+ Technician) Web Designer / Developer / DotNetNuke Portal Creator --- Clip those URLs! - Short links are easier to remember. http://clipurl.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Zip Code Fields
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
Re: [PHP-DB] Zip Code Fields
With MySQL you could do this: MEDIUMINT(5) UNSIGNED ZEROFILL Most databases (I think) would have an equivalent of this if you're using something else. Chris 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
RE: [PHP-DB] Zip Code Fields
Are you only accepting US zip codes? Justin -Original Message- From: Aaron Todd [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 8:36 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Zip Code Fields 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Zip Code Fields
i use varchar(10) for mine that way the starting 0 is not knocked off but it also allows for 0- format zips -- Joseph Crawford Jr. Codebowl Solutions [EMAIL PROTECTED] 802-558-5247 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php