Question: I am trying to store a phone number in mysql database. But it stores a different value.

```
<form align="center" method="post" action="sendingdata.php" enctype="multipart/form-data">

<label for="phone">Phone Number </label></br>
            <input type="number" name="phone" id="phone" placeholder="90000 12345"/>

            <input class="submit" type="submit" />

```

The following is the sendingdata.php

```
$phone = $_POST['phone'];
$q = sprintf("insert into posts(title,price,description,imagepath,name,phone) values('%s',%d,'%s','%s','%s','%d')", mysqli_real_escape_string($conn, $title), mysqli_real_escape_string($conn, $price), mysqli_real_escape_string($conn, $description), mysqli_real_escape_string($conn, $imageName),mysqli_real_escape_string($conn, $username),mysqli_real_escape_string($conn, $phone));

if (mysqli_query($conn, $q)) {
    header('Location: index.php');
    echo "success";
} 

```

The value I tried to input is 90000 00000. But the value stored in database is 2147483647

ps: The data type in mysql is BIG INT

Answer: 
That is the [maximum](https://dev.mysql.com/doc/refman/5.0/en/integer-types.html) `INT` size. Consider using a either `BIGINT` or a `VARCHAR` [column](https://dev.mysql.com/doc/refman/5.0/en/char.html), or a `CHAR` column with a fixed width.

`INT`'s maximum size is "2147483647" is signed and "4294967295" unsigned. Whereas a `CHAR` with a fixed length can be any number that is X digits/characters long. If you use a `CHAR` or `VARCHAR` column, be sure to validate your input first, as it will allow more than numbers in the value.
I think your datatype of your phone field is int so it is not able to store 90000 00000 try by changing it to bigint.