开发者

MySQL - Small query issue

开发者 https://www.devze.com 2023-02-19 14:16 出处:网络
I have a problem with a small query. When I execute it I am getting a error which is You have an error in your SQL syntax; check the manual that corresponds to your 开发者_开发百科MySQL server versi

I have a problem with a small query. When I execute it I am getting a error which is

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 'key=stqq WHERE id=75' at line 1

My query is as follows

UPDATE roles SET name=stylistqq, key=stqq WHERE id=75


add quotes

UPDATE roles SET name='stylistqq', key='stqq' WHERE id=75


Are stylistqq and stqq strings? If so, they should have single quotes around them. Pekka's recommendation to use a different column name other than key is also a good idea. You can make MySQL take that string by putting backticks around it, but you'll always need them.

0

精彩评论

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