Hello fellow humans!
I recently learned about
MANY to MANY relationships. I want to link my website to a mysql database and get data from it with PHP.
I've set up
4 tables. chapters, subChapters, images and ,texts.
when clicking upon a link I have two variables.. $mainID and $subID.
(mainchapter and subchapter)
What I need from the database is this:
ALL chapters, for the dropdownmenu
ALL subchapters that belong to the selected chapter, for the dropdownmenu
ALL images that belong to the selected subchapter
ALL texts that belong to the selected subchapter
I can accomplish this by sending a few mysql querys but as far as I've read that's a bad idea.
Is there a way I need to rearrange my tables or rearrange my query so that I can get all this information effectivly?
Are there some basic guidelines I should follow?
Is this a bad Idea in general?
I just want to learn it the right way from the start

A lot of thanks and love from me,
Geit