Jump to content

INT Field displaying strange results


leolanksford

Recommended Posts

Hi all,

I have a table which stores phone numbers amongst other details, currently the "phone" field is set up as: INT(20), Null = Yes, Default = 0

I recently tried to add the number '07000446639' to the db, but when i do this the db changes it to '2147483647'

Would any have any idea why it would be doing this?

Any help would be great,

Many thanks

Leo
Link to comment
Share on other sites


What i was tying to say was that when i add the number 07000446639 into the column 'PhoneNumber' for a specific record, the db changes what i have entered to '2147483647'

i have tried entering the number without the 9 at the end and it works fine, but as soon as i add the 9 the db changes the whole number to 2147483647

Link to comment
Share on other sites

Two things: first, it sounds like it might be too large, though this shouldn't be an issue for INT; second, if you want to keep that leading zero, you'd have to use ZEROFILL or switch to a CHAR column, which I would recommend anyway, since you can't do math with this field.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.