How to delete records from multiple tables in the same time?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mathsaddict
Forum Newbie
Posts: 1
Joined: Thu Apr 10, 2008 6:10 am

How to delete records from multiple tables in the same time?

Post by mathsaddict »

Well, the title is self explanatory :)
I've a project and i'm stuck with this problem, iw it possible and how efficient is it to perform deletion from multiple tables in the same time?
Can anyone post an example?
thanks you
User avatar
EverLearning
Forum Contributor
Posts: 282
Joined: Sat Feb 23, 2008 3:49 am
Location: Niš, Serbia

Re: How to delete records from multiple tables in the same time?

Post by EverLearning »

Code: Select all

DELETE t1, t2 
FROM t1, t2, t3 
WHERE t1.id=t2.id AND t2.id=t3.id;
Mysql Delete Syntax
Post Reply