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'");
I tried $result=mysql_query("DELETE FROM team,conflicts,home_field WHERE team_id = '$team_id'"); But of course, that doesn't work. Or do all of the tables HAVE TO have the $team_id in them for this to work. The conflicts and home_field tables might not have the $team_id in it. So I either have to do each table separately or have to come up with a way to delete from multiple tables even if the $team_id is not in the "team_id" column. Any suggestions? Thanks Steve --------------------------------------------------------------------- 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