Monday 3 September 2018

mysql query does not work

Okay, so my mysql query syntax is returning this 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 'read='yes' WHERE id='1'' at line 1

Here is the query:
$update = mysql_query("UPDATE newnotifications SET read='$read' WHERE id='$id'");

The variables are in the error. I honestly have no idea what is wrong in the syntax. I have even copied & pasted from another one I have that works and just filled in other values for what to updatewhere and set.

Read is a reserved word,enclose it in backticks
SET `read`

0 comments:

Post a Comment