Deleting from multiple tables
Hi
I've 3 tables, year, gallery and photos. The year and gallery tables are linked to each other via the year tables primary id key and photos table is linked to the gallery table via the gallery tables primary id key, as follows:-
Year Table
year_id
year
Gallery Table
gallery_id
year_id
name
Photos Table
photo_id
gallery_id
image
caption
What I want to be able to delete a year, all galleries associated to the year and delete all photos associated to those galleries all in one command. Where a gallery and or a photos id does not exist, I still want to be abl eto delete the year. I think I need to do this using a left join, but I'm struggling with the concept/structure of the command.
Any pointers in the right direction would be greatly appreciated.
Thanks.
