phpmyadmin - What is the issue with 10 digit mobile no data in mysql? -


I have created a table to store the user's contact records of my website. It also includes a 10 digit mobile number.

The table structure is like this:

  create contact contact (id INT not pure AutoConnect primary key, contact INT (10))  

The problem now is that if I allow 10 mobile numbers (eg 9 5958 9 1256) using phpmyadmin in the contact area, then it will insert some random value and ""

but if I Insert a simple 10 digit number (for example 4561327894) then it works well and warns Minister does not appear.

So please tell me that there is no one in this pillar of mobile?

I am using mysql 5.1 on Ubuntu 11.04 and am using phpmyadmin.

INT (10) does not mean 10 digits, it means a 10 digit display Width is Whether you have placed INT (2) or INT (10), MySQL still stores only one (unsigned, in this case) INT, whose maximum value is 42 9 49672 9 5.

You can use BIGINT instead of INT, store it as a numeric, I do not recommend it, however, because it will not allow international numbers. If you are certain that your application is only Using the US number, using BIGINT will save you more than 3 bits per line VARCHAR (10) - if such a thing makes you worry.

Since this is a phone number and therefore you will not count numerically against it), try using VARCHAR (20). This gives you the ability to store international phone numbers properly, so this requirement arises.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -