开发者

MySQL query giving error 1064 - any ideas?

开发者 https://www.devze.com 2023-03-01 16:00 出处:网络
This query: UPDATE jos_content SET fulltext=\'\\r\\n<br /> \\" some other text\' WHERE id=3

This query:

UPDATE jos_content SET fulltext='\r\n<br /> \" some other text' WHERE id=3

gives:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corres开发者_StackOverflow中文版ponds to your MySQL server version for the right syntax to use near 'fulltext='\r\n<br /> \" some other text' WHERE id=3' at line 1

Anyone has any idea why?


fulltext is a reserved word.

http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html

rename your field or put it within backticks '`' (alt + 96)

like so:

UPDATE jos_content SET `fulltext`='\r\n<br /> \" some other text' WHERE id=3
0

精彩评论

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

关注公众号