I am creating a user id for a web site and in the site, the user enters a phone number, only numbers, 10 digits. When they enter fewer digits, it stores the number fine but when they enter 10 digits, it saves the number 2147483647 no matter what they put in. What is happening here.
Page 1 of 1
Storing phone numbers in a database.
#2
Posted 07 February 2012 - 10:53 AM
hiya,
sounds like the data type of the col (asuming your using mysql)... try changing it from a int to a varchar
sounds like the data type of the col (asuming your using mysql)... try changing it from a int to a varchar
#3
Posted 07 February 2012 - 11:24 AM
gigman7, on 06 February 2012 - 08:22 PM, said:
I am creating a user id for a web site and in the site, the user enters a phone number, only numbers, 10 digits. When they enter fewer digits, it stores the number fine but when they enter 10 digits, it saves the number 2147483647 no matter what they put in. What is happening here.
I think it's the top end of the INT datatype holding you back. You might want to try BIGINT. And you might want to make it an 11-digit unsigned zero-fill while you're at it.
Share this topic:
Page 1 of 1
Help














