On Fri, Aug 22, 2008 at 12:28 PM, Afan Pasalic <[EMAIL PROTECTED]> wrote:
>
>
> tedd wrote:
>>
>> At 8:44 PM -0600 8/21/08, Keith Spiller wrote:
>>>
>>> Hi,
>>>
>>> RE:  Restore Leading Zeros in Zip Codes
>>>
>>> Does anyone happen to have a script that will restore the leading zeros
>>> in a mixed data set of 5 digit zip codes and 10 digit zip+4 codes?  Any
>>> suggestions?
>>>
>>> Thanks,
>>>
>>> Keith
>>
>> Keith:
>>
>> Why take them out in the first place? Keep the zip code as a string. After
>> all, not all countries use just numbers.
>>
>> Cheers,
>>
>> tedd
>
> or, if you use US zip codes only, use ZEROFILL feature in mysql?
>
> -afan

Definitely not. Tedd and Dan are correct; the zeros are significant,
not just filler. Keep in mind that ZIP codes ARE NOT numbers at all,
even if they look like numbers in the US. They are postal codes, which
are a string of character data even if all the characters are numeric
digits. Just expand your database to include Canada and it will become
abundantly clear that a numeric data type is not correct for postal
codes.

Andrew

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

Reply via email to