I know SQL well but I must be missing something really dumb here. This update query keeps throwing an error. The query is:
UPDATE pages SET 'order' = 1 WHERE id = 19
The table definitely has a column for order, and it has a record with the ID of 19. The order column is not unique.
The error I get is the generic one:
#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 '"order" = 2 WHERE id = 19' at line 1
I've enclosed order in quotation marks because ORDER
is a reserved SQL word. What am I missing?
If using MySQL the query should look like this:
UPDATE `pages` SET `order`=1 WHERE `id`=19
That looks like a MySQL error message. Doesn't MySQL use backticks (`) for escaping?
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