I apologize for having to post this line of code, but I have an issue with it and I can't seem to resolve it.
Here is the line of code:
$finished1 = mysql_query("INSERT INTO guests_old(ticketnumber, customername, customerphone, datecheckin, computerlocation) VALUES('$_POST[ticket]','$_POST[name]', '$_POST[phone]', '$_POST[checkin]', '$_POST[location]'") or die(mysql_error());
and here is the MySQL error:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Thank you for your help!
Also, here is the whole PHP Script in case it helps to explain my situation.
<?
$conedit = mysql_pconnect("localhost","ethanwe_ethan","password")
or die("Unable to connect to SQL server");
mysql_select_db("ethanwe_timpc", $conedit) or die("Unable to select database");
$editdata = mysql_query("UPDATE guests SET customername='$_POST[name]', customerphone='$_POST[phone]', datecheckin='$_POST[date]', computerlocation='$_POST[location]' WHERE ticketnumber = '$_POST[ticket]'") or die("Hey");
$finished1 = mysql_query("INSERT INTO guests_old(ticketnumber, customername, customerphone, datecheckin, computerlocation) VALUES('$_POST[ticket]','$_POST[name]', '$_POST[phone]', '$_POST[checkin]', '$_POST[location]'") or die(mysql_error());
$finished2 = mysql_query("DELETE FROM guests WHERE ticketnumber = '$_POST[ticket]'") or die("Unable to write to database2");
if ($_POST[edit]){
mysql_query($editdata);
}
else if ($_POST[finished]){
mysql_query($finished1) or die(mysql_error());
//mysql_query($finished2) or die('3mysql_error()');
}
?>