Q:

Not able to Inserting Correct Mobile number to phpMyAdmin using PHP

If the mobile number 1234567890, the below code is working fine.
If the mobile number is either 2134567890 or another other number not starting with 1, the below code is inserting this number "2147483647" and code is not giving correct output.
Using POST method of FORM i'm getting the values and ACTION is $_SERVER['PHP_SELF']
Using isset($_POST['submit']), written below the code.
Here is the Code:
$sql=mysql_query("insert into registration (regname,regmobile) values ('$_POST[regname]','$_POST[regmobile]')");
$sql1=mysql_query("select * from registration where regmobile='$_POST[regmobile]'");
if(mysql_num_rows($sql1)>0)
{
    while($row=mysql_fetch_array($sql1))
    {
        $regname=$row['regname'];
        $regmobile=$row['regmobile'];
        $regid=$row['regid'];
        $reguserid=substr($regname,1,2).substr($regmobile,-4).substr($regid,-2);
        $sql2=mysql_query("update registration set reguserid='$reguserid' where regmobile='$regmobile'");

    }
}

Thanks & Regards
Swetha

A:

Consider a different data type:
bigint
-2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807)

int
-2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647)

smallint
-2^15 (-32,768) to 2^15-1 (32,767)

tinyint
0 to 255

Alternatively as mentioned by blue112, try using VARCHAR

