I need this query – update last but one record.
UPDATE changes SET checked='' WHERE item_id = 119898 AND type = 'example_edit' AND checked != 'restored' ORDER BY id DESC LIMIT 1, 1
Database echos:
#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 ' 1' at line 1
What is wrong near 1?
Standard update staement
for your case try this
Try it will really help you, code tested.
Limit in update can only use row counting not 1,1 etc.