Ok, I have two tables that I'm working with: tblUser and tblUserRegion.
tblUser has userID, userEmail, userAddress.
tblUserRegion has userRegionID (PK), userID and userRegion. it has a 1:n ration between userID and userRegion...there is a separate entry for each region a user is part of.
Using foreign keys is unfortunately not an option with this MySQL setup. So: when I delete a user from tblUser, I'd like to make sure that all mentionings of them get deleted from tblUserRegion as well.
Trying something like this:
DELETE tblUsers, tblUserRegions FROM tblUsers, tblUserRegions WHERE tblUsers.UserEmail="email@email.com" AND tblUsers.UserID=tblUserRegions.UserID
But it doesn't seem to be right. Any advice?
thanks,
Rob
tblUser has userID, userEmail, userAddress.
tblUserRegion has userRegionID (PK), userID and userRegion. it has a 1:n ration between userID and userRegion...there is a separate entry for each region a user is part of.
Using foreign keys is unfortunately not an option with this MySQL setup. So: when I delete a user from tblUser, I'd like to make sure that all mentionings of them get deleted from tblUserRegion as well.
Trying something like this:
DELETE tblUsers, tblUserRegions FROM tblUsers, tblUserRegions WHERE tblUsers.UserEmail="email@email.com" AND tblUsers.UserID=tblUserRegions.UserID
But it doesn't seem to be right. Any advice?
thanks,
Rob