LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-31-2004, 11:20 PM   #1
familyman
LQ Newbie
 
Registered: May 2004
Distribution: Redhat/Debian
Posts: 10

Rep: Reputation: 0
MySQL omits my 0 placeholders


I have a MySQL database. I have started storing phone #s in it. The phone number fields are of the INT type. I have 1 phone number split into AREACODE, PREFIX, and SUFFIX. I have a phone # who's suffix is "0986". When I put it in, it turns it into "986", omitting my 0 placeholder. I can't figure out how to prevent this. Any ideas?
 
Old 09-01-2004, 03:51 AM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Change the type from ints? Check you're putting ints in and cast them as ints when removing them, but maybe store them as a string to keep the 0s, or adapt your app to add the leading 0 back.
 
Old 09-02-2004, 11:01 PM   #3
familyman
LQ Newbie
 
Registered: May 2004
Distribution: Redhat/Debian
Posts: 10

Original Poster
Rep: Reputation: 0
Duh! Yeah I'll just make it a string. Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-07-2008 11:48 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration