deleting from two different tables at the same time.
Posted: Mon Jan 14, 2008 11:31 am
Hi,
I’m trying to delete from two separate tables with the following code:
Both tables have the same value ‘barney’ and if I run the query with just one table being queried then the delete is carried out it’s just when I try include both tables in the quesy I get the incorrect message:
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 letter_number_ns=barney AND letter_number=barney'
I’m trying to delete from two separate tables with the following code:
Code: Select all
$deleteSQL = sprintf("DELETE FROM news_letters_ns, word
WHERE letter_number_ns=barney
AND letter_number= barney",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 letter_number_ns=barney AND letter_number=barney'