I’m getting the following error from the following code. Connection works with no errors, all the input columns are correct, and I’ve dumbed down the inputs to just 0’s to make sure it wasn’t the variables I was passing. Any help would be greatly appreciated. MySQL ver 5.5.28.
FAILURE 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 ‘keys, values, childID, accessID) VALUES (‘0′,’0′,’0′,’0′)’ at
line 1
$query="INSERT INTO carts (keys, values, childID, accessID)
VALUES
('0','0','0','0')";
echo $query;
if (mysqli_query($link, $query) == FALSE) {echo "FAILURE " . mysqli_error($link);}
Been working 20 hours without sleep so if this a facepalm moment, I wont be surprised. I will say that I’ve never used mysqli, just mysql commands.
keysandvaluesare a reserved words You can wrap it in backticks.