简体   繁体   中英

mysql query doesn't 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 update , where and set .

请尝试以下查询:

$update = mysql_query("UPDATE newnotifications SET `read`='$read' WHERE id='$id'");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM