|
aagmailcom
Anon
2012-Jun-4 5:53 am
When Inserting into table it stores some garbage valuesWhenever 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 :
$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.
Please someone help me to remove this. |
|
lunarPlexusNothin' Up Muh Sleeve Premium Member join:2003-02-08 Chicago, IL |
That number is the maximum value for an int field. Change to bigint. You have the values in quotes though, so maybe they shouldn't be numeric at all? |
|
dave Premium Member join:2000-05-04 not in ohio
1 recommendation |
to aagmailcom
OT: 2147483647 is one of those numbers that programmers need to be able to recognize on sight. Once you recognize that it's the largest signed integer that fits in 32 bits, the rest of the problem becomes much simpler to understand. |
|
SteveI know your IP address
join:2001-03-10 Tustin, CA
1 recommendation |
Steve
2012-Jun-5 10:46 am
said by dave:OT: 2147483647 is one of those numbers that programmers need to be able to recognize on sight. Once you recognize that it's the largest signed integer that fits in 32 bits, the rest of the problem becomes much simpler to understand. 2147483647 is the new 255 |
|
|
dave Premium Member join:2000-05-04 not in ohio
1 recommendation |
dave
Premium Member
2012-Jun-5 10:53 am
Actually, 4294967295 is the new 255.
2147483647 is the new 127. |
|
|
Actually, 2147483647 is the new 32767.
4294967295 is the new 65535. |
|
lunarPlexusNothin' Up Muh Sleeve Premium Member join:2003-02-08 Chicago, IL |
to aagmailcom
I guess we'll never see the OP again. This thread delivers max(humor) though. |
|
dave Premium Member join:2000-05-04 not in ohio |
to sbconslt
Actually, 1,114,111 is the new 127. said by www.unicode.org :In the Unicode Standard, the codespace consists of the integers from 0 to 10FFFF (base 16), comprising 1,114,112 code points available for assigning the repertoire of abstract characters. |
|