tay*_*low 3 php mysql sql database phpmyadmin
我有一个包含18列表的数据库,其中第二列称为"desc".我想删除"desc"下具有特定值的每一行.我正在使用此代码:
DELETE FROM items WHERE desc='Swap this note at any bank for the equivalent item.'
Run Code Online (Sandbox Code Playgroud)
在PHPMYADMIN中使用此命令给我这个错误:
#1064 - 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 'desc='Swap this note at any bank for the equivalent item.'' at line 1
Run Code Online (Sandbox Code Playgroud)
我环顾四周很好,但我似乎无法找到我做错了什么.
mySQL版本是5.5,phpMyAdmin版本是3.4.5.
您需要使用反引号,desc因为它是使用时降序的关键字ORDER BY:
DELETE FROM items
WHERE `desc`='Swap this note at any bank for the equivalent item.'
Run Code Online (Sandbox Code Playgroud)