473,809 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

telephone number column type

What is the recommended way of storing 10 digit phone numbers? I like
bigint(10), but it seems most are using varchar? Or I've also seen 2
int columns, one for area code and another for the rest of the digits?

I wish phone numbers had their own column type, so I can send
123-456-7890 or (123) 456-7890 or whatever and have mysql do the right
thing.
Jul 19 '05 #1
2 12063
chris wrote:
What is the recommended way of storing 10 digit phone numbers? I like
bigint(10), but it seems most are using varchar? Or I've also seen 2
int columns, one for area code and another for the rest of the digits?

I wish phone numbers had their own column type, so I can send
123-456-7890 or (123) 456-7890 or whatever and have mysql do the right
thing.


I would recommend using varchar. Then it should be quite easy to put the
data in the format you like, and read it out in the same format you put
it in.

Jul 19 '05 #2
chris wrote:
What is the recommended way of storing 10 digit phone numbers? I like
bigint(10), but it seems most are using varchar? Or I've also seen 2
int columns, one for area code and another for the rest of the digits?

I wish phone numbers had their own column type, so I can send
123-456-7890 or (123) 456-7890 or whatever and have mysql do the right
thing.


I would recommend using varchar. Then it should be quite easy to put the
data in the format you like, and read it out in the same format you put
it in.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10403
by: Ashish | last post by:
I wanted to make a Java application which would dial a telephone number using the modem. When the person on the other end lifts up the telephone (answers the phone), the application should start playing an audio file(eg. .wav file). The approach I took was using the Java Communications API(javax.comm.). As my modem is connected to the serial port on my computer I send AT commands to make the phone call (ATDT2222222). This is working...
0
1877
by: chris | last post by:
What is the recommended way of storing 10 digit phone numbers? I like bigint(10), but it seems most are using varchar? Or I've also seen 2 int columns, one for area code and another for the rest of the digits? I wish phone numbers had their own column type, so I can send 123-456-7890 or (123) 456-7890 or whatever and have mysql do the right thing.
4
7542
by: Iftikhar Hussain | last post by:
Hello Everyone Nice to be back here, well all u guys have helped in past & now I would like a favor again. first what i want to develop is as follows: An application for rescue station, where there is a Telephone & a Computer System . the telephone is also connected with the computer system, so when the telphone rings, the Computer can act as a CLI & could identify, which number the call is coming from. it gets that number, matches it...
4
1709
by: Richard | last post by:
When i try sorting in the database, it sorts the numbers: 0 1 102 2 304 305 4 etc....
3
1075
by: Larry Rekow | last post by:
I've built various web apps using Frontpage and/or ASP and Access, but now I'm trying to figure a way to do the following, perhaps in ASP.Net My friend gets parts lists in invoices (they are in an excel spreadsheet) that he has to classify as a certain type: eg. part number 111-111-111 is type R9, and part 222-222-222 is type 486, etc. we have a database that is not quite complete, but contains most of these classifications.
1
1147
by: Ed Dror | last post by:
Hi there, I have Access database with telephone column and When I created a webform data grid With VWD 2005 this column show like this 5552223333 how do I format it like (555)222-3333 Thanks, Ed Dror
1
1840
by: Robert Johnson | last post by:
Hi all. I need to format my text box's and combo box's with Telephone (###) ###-#### and Postal Code #####-#### or other custom formating, how do I do this? I tried to go into Properties, Databindings, Advanced and to use the Custom but it didn't work to well. To clarify: it placed (###) ###-#### in my Telephone field but didn't guide my user or format the number after entering data, so it was pretty useless. Obviously I didn't do it...
9
1651
by: =?Utf-8?B?TWlrZTk5MDA=?= | last post by:
I save a number in the table and want to get that number again, but the number I get has lower precision than I expect. For example, when I divide 10/3 I get 3.3333333333333335 if the variable is of type Double. But saving this result into a table with a column of type Double decreases the precision to 3.333333333333333 , so when I get this number and multiply it 10 I do not get that exact number which is 10. How can I solve this...
1
2253
by: silent15 | last post by:
I am having a bit of trouble writing a function for a telephone directory. I need to create a program that upon prompt of first and last name it needs to output the corresponding number from a dat file or indicates that the name isnt in the file. then after each lookup i need to ask whether to look up another number or exit. this is the code I have so far, I am not very good with functions so... #include <iostream> #include <string>...
0
2868
by: tlontz | last post by:
I am trying to retrieve the telephone_number from active directory using the following script: Dim search As New DirectorySearcher("") search.Filter = "(&(objectCategory=Person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(samaccountname=" + UserName.ToString.Trim + "))" 'search.Filter = "(&(!(userAccountControl:1.2.840.113556.1.4.803:=2))( objectCategory=person)(samaccountname=" +...
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10637
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10379
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3014
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.