I have a guest id that exists in 3 different tables. I want to delete a guest in one step. How do I use the DELETE statement to delete all data associated with that guest id in all 3 tables with out having to do it 3 separate times ?
Here's what I have:
DELETE FROM guests WHERE guest_id = $guest_id
DELETE FROM guest_dates WHERE guest_id = $guest_id
DELETE FROM links WHERE guest_id = $guest_id
I also tried:
DELETE FROM guests, guest_dates, links WHERE guest_id = $guest_id
Then I learned you can only delete from one table with the delete statement.
What other way can I accomplish this ?