jaxdevil Posted November 14, 2007 Share Posted November 14, 2007 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 More sharing options...
pocobueno1388 Posted November 14, 2007 Share Posted November 14, 2007 Put a die at the end of your query $result = mysql_query($query); Also, try echoing the query out to see if it comes out right. Link to comment https://forums.phpfreaks.com/topic/77334-solved-insert-function-not-working/#findComment-391524 Share on other sites More sharing options...
revraz Posted November 14, 2007 Share Posted November 14, 2007 Looks like you have mismatching quotes here VALUES('" . $lotnum2 . '0' . "$bidnum2', Link to comment https://forums.phpfreaks.com/topic/77334-solved-insert-function-not-working/#findComment-391525 Share on other sites More sharing options...
jaxdevil Posted November 14, 2007 Author Share Posted November 14, 2007 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 Link to comment https://forums.phpfreaks.com/topic/77334-solved-insert-function-not-working/#findComment-391537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.