Reputation: 153
Whenever I am inserting data into mysql database wiht below insert query then query runs successfully but when I check the data from database then it show some other values rather than the original values whatever I have inserted through the query . I use PHP and MySQL to execute the insert query. Please if anyone have any solution then please help me to resolve this problem.
My Code is :
<?php
$conn = mysql_connect('localhost','root','asterisk') or die("Cannot Connect with Databse") ; //connect with database
mysql_selectdb('adore3', $conn) or die("Cannot Select the Database ") ;//select database
$query_insert="INSERT INTO cc_transfer VALUES ('', '528', '258', '1', '2012-5-5 4:4:4','5555555558888888','99999994444444',0);";
$r = mysql_query($query_insert);
if($r)
{
echo "Inserted";
}
?>
But when I check the data then I don't found the values 5555555558888888
and 99999994444444
, there are some garbage values in both field 2147483647
.
Upvotes: 3
Views: 1735
Reputation: 1831
The values you are trying to store are larger than the integer data type I assume you have set for the field in db. The 2147483647 is the max integer value that can be stored. Change the data type for the field (to long values).
Upvotes: 4