I am getting this error when I execute this script:
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 'table) VALUES (3, 4)' at line 1
This is my code:
$tableNum = 3;
$coverNum = 4;
//construct query & execute
$sql = "INSERT INTO orders (covers, table) VALUES ('$tableNum', '$coverNum') ";
$result = mysql_query($sql) or die(mysql_error());
$numrows = mysql_num_rows($result);
//return value
if($numrows > 0)
{
echo 'Success';
}
else
{
echo 'UnSuccessful';
}
What is wrong?... Many thanks for any help on issue.
mysql_num_rows() expects parameter 1 to be resource
I will make new question maybe? – Javacadabra Feb 21 at 20:33