Re: is there an easy way to do a cascading delete using PEAR::DB?
| From: | Lukas Smith | 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: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, LukasI 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.