I want to delete certain items from the database. I have the following query:
SELECT *
FROM sheets, entries
WHERE entries.sheetID = sheets.id AND sheets.clientID = 13
This works, and returns 2 results.
Now I want to turn this SELECT
query into a DELETE
query. However, the following doesn't work:
DELETE FROM sheets, entries
WHERE entries.sheetID = sheets.id AND sheets.clientID = 13
MySQL throws the following 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 'WHERE entries.sheetID = sheets.id AND sheets.clientID = 13' at line 1
What am I doing wrong here?