3

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.

1
  • I guess something went wrong with submitting your code: I don't see an y of it Commented Jun 4, 2012 at 9:22

1 Answer 1

4

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).

Sign up to request clarification or add additional context in comments.

1 Comment

I know "thanks" isn't allowed around here, but just between you and me... well... you know...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.