Re: is there an easy way to do a cascading delete using PEAR::DB?

From: Date: Tue, 16 Nov 2004 22:41:30 +0000
Subject: Re: is there an easy way to do a cascading delete using PEAR::DB?
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15576@lists.php.net to get a copy of this message
Andrew Nagy wrote:
Stowe Spivey wrote:
I have some code that works but I am moving what I can over to DB code. Problem: Several tables, B, C, D are related to table A. When I delete A, I need to delete all the other tables that have records related to that record. Solution: Use PHP to do multiple delete sql statements OR ?
If you are using a database (such as Postgres or MySQL with InnoDB) that supports it, it would be many times faster to use the database itself.
if not then your best solution is to hook this into a query builder because parsing a query is probably not feasible in order to be able to emulate cascading deletes. regards, Lukas

« previous php.pear.general (#15576) next »