oskare100 Posted January 22, 2007 Share Posted January 22, 2007 Hello,$item_number is one value but the MySQL querey inserts another.[code=php:0]Here is the code:$item_number = $_POST['item_number'];$sql46="INSERT INTO $sales_tbl (user_id, pack_id, ebay_item_name, ebay_item_id, ebay_txn_id, shipped_marked, paid_marked, payment_status, payment_date, payment_gross, payment_tax, payment_currency, payment_type, paypal_txn_id, paypal_memo, auction_closing_date, auction_multi_item, received) VALUES('".$row['user_id']."', '".$ident_row['file_id']."', '$item_name', '$item_number', '$ebay_transaction_id', '$shipped_marked', '$paid_marked', '$payment_status', '$payment_date', '$mc_gross', '$tax', '$mc_currency', '$payment_type', '$txn_id', '$memo', '$auction_closing_date', '$auction_multi_item', NOW())";$result46=mysql_query($sql46) or die( mysql_error() );}//Send new purchase message to buyer$to = "[email protected]";$subject = 'subject';$message = "Item number: $item_number";$headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);[/code]$item_number = 110079832134, and that's also the item number that is emailed to be. But when I look at the database 2147483647 has been inserted instead!? And it always inserts 2147483647 instead of the actual number so please help me, what's wrong?? The database ebay_item_id is int(15).Thanks in advance,/Oskar R Link to comment https://forums.phpfreaks.com/topic/35228-php-inserts-another-value-into-the-database/ Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 Just on first glance I'd say the int(15) is too small. Make it a bigint or something higher. Sounds like you're out of range. Is the int(15) unsigned as well? Link to comment https://forums.phpfreaks.com/topic/35228-php-inserts-another-value-into-the-database/#findComment-166340 Share on other sites More sharing options...
oskare100 Posted January 22, 2007 Author Share Posted January 22, 2007 Hello,Doesn't int(15) mean that it can be 15 numbers? The item_number is never more than 12 numbers. Is the int(15) unsigned as well? Could you please explain that? Sorry for not understanding, but I'm not that good at MySQL.Best RegardsOskar R Link to comment https://forums.phpfreaks.com/topic/35228-php-inserts-another-value-into-the-database/#findComment-166346 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.