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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.