Re: Help with a query please
| From: | heilo | Date: | Mon, 24 Mar 2003 15:36:03 +0000 |
| Subject: | Re: Help with a query please | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-26599@lists.php.net to get a copy of this message | ||
Hi!
I hope, I understood you right: You want to delete a user completely from
your database?
If yes, you can just do it step by step (I hope the last step - putting all
the queries together works):
$uid = 1;
$qry = 'SELECT
Allocation_ID FROM WMS_Allocations WHERE
User_ID='.$uid;
$ent = mysql_fetch_array(mysql_query($qry));
$del_qry1 = 'DELETE FROM WMS_Allocations WHERE User_ID='.$uid;
$del_qry2 = 'DELETE FROM WMS_Bookings WHERE
Allocation_ID='.$ent['Allocation_ID'];
$del_qry3 = 'DELETE FROM WMS_User WHERE User_ID='.$uid;
$del_qry = $del_qry1.";\n".$del_qry2.";\n".$del_qry3.";\n";
mysql_query($del_qry);