开发者

What is wrong with this MYSQL statment?

开发者_如何学Go

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';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜