Is it not possible to perform two deletes in one query by separating them with a semicolon?
Here is my query:
$query="DELETE FROM $sql_table
WHERE EXISTS
(
SELECT 1
FROM classified
WHERE classified.poster_password = '$pass'
AND classified.ad_id = '$id'
AND classified.classified_id = $sql_table.classified_id
);
DELETE FROM classified
WHERE classified.poster_password = '$pass'
AND classified.ad_id = '$id'";
This gives this error:
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 'DELETE FROM classified WHERE classified.poster_password = 'xxxxxxx' at line 10
Please help me solve this one, it is starting to give me a headache. I need it in one query...
Thanks