[Newbie] Cascade delete manually

From: Date: Thu, 01 May 2003 05:22:38 +0000
Subject: [Newbie] Cascade delete manually
Groups: php.general 
Request: Send a blank email to php-general+get-145900@lists.php.net to get a copy of this message
Hiya I just wanted to know if there was any tips people could offer me regarding cascade deletes. im using mysql and want to hard code delete query that traverses the necesssary tables using php. For e.g. I had a Project table, which contains loads of bugs (in the bug table). Every bug is stored with the foreign key projid so to know which bugs are related to which projects. Now inside every bug I allow the option to add a followup to update the bug such as status of the bug....(This data stored in the bug_followup table). Now say I want to delete a project I can get all the bugs in that project with: select bugid from bug, project where bug.projid=project.projid; Now I can get all the followups of the bug also doing(im guessing): select * from bug_followup, bug where bugid=bug.bugid. But just not sure how to join up the queries?I should do this? Is there a way to build a nested query such as in php: delete * from bug_followup where bugid =(select bugid from bug where projid=$projid; Thanx Bobster _________________________________________________________________ Hotmail messages direct to your mobile phone http://www.msn.co.uk/mobile

« previous php.general (#145900) next »