----- Original Message -----
From: "Steve Buehler" <[EMAIL PROTECTED]>
To: "mysql" <[EMAIL PROTECTED]>
Sent: Thursday, May 23, 2002 8:45 PM
Subject: Deleting from multiple tables
> I am using MySQL with a PHP front end. Is there a better way to delete
> from multiple tables than the following?
>
> $result=mysql_query("DELETE FROM team WHERE team_id = '$team_id'");
> $result=mysql_query("DELETE FROM conflicts WHERE team_id = '$team_id'");
> $result=mysql_query("DELETE FROM home_field WHERE team_id = '$team_id'");
If there is, I have not found any. For my news server, I have newsgroup
tables. So, when I want to cancel an article, I have to loop several tables
for matching message-ids. Since, with the help of the good people here, I
have now an extra index of message-ids, things go pretty fast; but, yeah, it
would be great to match all in one swoop.
It would be cool if MySQL would one day allow you to make a "meta" index,
not just of unique keys, but of possibly the same keys in a different name
space (like mytable1::mykey + mytable2::mykey); kinda like the way Perl
handles global and package variables.
- Mark
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php