[mySQL] delete from multiple tables

I’m trying to delete records from two tables (in the same db)… my query statement is structured like this:

delete from table_1 where id='7'; delete from table_2 where id='7';

Now, if I copy and paste that into phpmyadmin, it perfectly works. When it’s part of my script it doesn’t work, however :frowning:

Anyone got a clue how to fix this? :slight_smile:

http://forums.devshed.com/t55986/s.html

I don’t think its possible in one statement…

ah… no worries then… thanks for the link :slight_smile:

what happens if you do
delete from table_1,table_2 where id=‘7’; ?
or if you use a “join”…

i didn’t try using the two tables with a comma separating them… that might work :slight_smile:

As for a join, I’ve read on another forum that you can perform a join for deletion :slight_smile: