Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
We don't bite newbies here... much
 
PerlMonks  

Re: Question about phone number storage.

by Elgon (Curate)
on Jan 18, 2001 at 11:33 UTC ( [id://52749]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Question about phone number storage.

Ah, something close to my heart - one of the first serious programs I wrote in Perl was a script that generates a 'contacts page' from a MySQL database pauses briefly to reminisce over carefree days of coding.

Varchar is definitely the way to go - you don't need to do any arithmetic, (as has been pointed out) leading zeros are not cut and what you are entering isn't really a number, it is a string of digitsNote: I'm sure that made sense the first time round.

Remember to make your field nice and big for when they decide to change number yet again etc...

Elgon

UPDATE: I knew I forgot something - If you want to give international phone numbers, ie. something like +44 (0) 1234 765 4321, with spaces and brackets varchar is obviously the way to go because it allows this kind of encoding and also allows numbers of different formats.

Update on UPDATE I just noticed that lzcd already posted this reason, oh well, goodbye originality!

  • Comment on Re: Question about phone number storage.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://52749]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.