[thelist] MySql - checking two tables at once.

rudy r937 at interlog.com
Sun Jan 6 08:51:41 CST 2002

>>That should do the trick in one delete
> you sure? what if the email isn't in one of the tables?
> if this is legal syntax (and i'm not sure it is)...

it isn't

> delete from tblAdvise, tblEmails where tblAdvise.Email = '$email' or
> tblEmails.Email = '$email';

thanks for taking it to that extreme, matt, because now it should be
abundantly clear why deleting from joined tables should not work -- you're
missing a join condition, so every row of tblAdvise will be joined to every
row of tblEmails, and in particular, if $email exists in either table, then
the delete should wipe the other table out completely!!

sorry adrian, i have no idea what &death is



More information about the thelist mailing list