For the life of me i've been staring at this for 5 minutes and can't figure out why MYSQL is spitting it back on me
UPDATE noti SET read=(read+1) WHERE id='2068';
Thanks!
In MySQL, READ
is a reserved keyword. You'll need to enclose the column read
in backquotes to keep it from being misinterpreted as the READ
keyword and correctly interpreted as your column name.
UPDATE noti SET `read`=(`read`+1) WHERE id='2068';
More here: http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
read
is one of MySQL's reserved words.
Try this:
UPDATE noti SET `read` = `read` + 1 WHERE id = '2068';
精彩评论