Jump to content

[SOLVED] insert function not working


jaxdevil

Recommended Posts

I know i missed up somewhere in this, but I can't locate where. Anyone see what i did wrong? When i run this the database is not affected, all the settings are correct for user, host, login, table, etc. I hav e a duplicate insert script I use to insert some other information in this database table, but i changed which rows are being inserted to and it stopped functioning. I verified the rows listed in the insert statement are spelled exactly as they are here. I keep going over it and do not see anything wrong with the variables, they are passed using a post form to this script and i switched it to get jsut so i could manua;;y see that the right data is being sent to the script, it is. I have to have a typo or something in here and just can't figure it out...

 

<?php
mysql_connect("localhost","auction_asset","xxxxxx");
mysql_select_db (auction_asset);
$query = "INSERT INTO checkout(id, bidnum, lotnum, amt, paid, qtty, descrip, per_price, exempt)
VALUES('" . $lotnum2 . '0' . "$bidnum2', '$bidnum2','$lotnum2,'$amt2','no','$qtty2','$descrip2','$per_price2','$exempt2')";
$result = mysql_query($query);
echo "Inserted";
?>

Link to comment
https://forums.phpfreaks.com/topic/77334-solved-insert-function-not-working/
Share on other sites

Thanks guys, i appreciate you taking the time to try and help. I found the problem though, there is a ' left off on the second $lotnum2, the one just before $amt2. I found it using the die command. thanks for reminding me, I keep forgetting to add that.

 

Thanks!

SK

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.