I have a database with a table with 18 columns, the second of which is called "desc". I want to delete every row that has a certain value under "desc". I'm using this code:
DELETE FROM items WHERE desc='Swap this note at any bank for the equivalent item.'
Using this command inside of PHPMYADMIN gives me this error:
#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
I've looked around pretty well but I can't seem to find what I'm doing incorrectly.
mySQL version is 5.5, phpMyAdmin version is 3.4.5.
You'll need to use backticks around desc as it is the keyword for descending order when using ORDER BY:
DELETE FROM items
WHERE `desc`='Swap this note at any bank for the equivalent item.'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With