开发者

error in updating mysql table with filters

开发者 https://www.devze.com 2023-02-25 04:10 出处:网络
i have a mysql table with the follwoing fields : id, desc, value, people, amount, weight in the above order i run the follwoing

i have a mysql table with the follwoing fields :

id, desc, value, people, amount, weight

in the above order i run the follwoing

update match1 set weight = 5 where desc = 'fat' and id != '6';

follwoing is the error message i get :

**#1064 - You have an error in your SQL syntax; check the manual that** 
corresponds to your MySQL serve开发者_如何学Pythonr version for the right syntax 
to use near 'desc = 'bat' and id = 6' at line 1

can someone please let me know whats wrong with this?


the column desc is a keyword in mysql. use backquotes i.e.

where `desc` = 'fat'
0

精彩评论

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