Ok, i've connected to thousands of databases before and now I am running into a brick wall. Maybe I have been looking at the code too long or something, but can anyone see any problems with this code:
$dbh=mysql_connect ($servername, $dbusername, $dbpassword);
$db_selected = mysql_select_db($dbname, $dbh);
if (!$db_selected){
die (mysql_error());
if (!$dbname) error_msg(sql_error());
}
$sql = "INSERT INTO Order (CustomerID, OrderTotal, OrderDate, Magazine) VALUES ('$custom','$payment_amount','$payment_date','$item_name')";
$result = mysql_query($sql);
if ($result == false){
echo mysql_errno().":".mysql_error()."<BR>";
exit;
}
I am getting the error:
1064: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 'Order (CustomerID, OrderTotal, OrderDate, Magazine) VALUES ('te
all variables are just set = "test"
I'm sure it is something stupid that I am missing, but I can not figure it out...