LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   MySQL omits my 0 placeholders (https://www.linuxquestions.org/questions/programming-9/mysql-omits-my-0-placeholders-225097/)

familyman 08-31-2004 11:20 PM

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?

Proud 09-01-2004 03:51 AM

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.

familyman 09-02-2004 11:01 PM

Duh! Yeah I'll just make it a string. Thanks


All times are GMT -5. The time now is 08:27 PM.