I've got a MySQL database which has 3 tables - category, section and subsection.
There are two categories, which each have 3 sections, which each have 3 subsections.
The section table contains a section id, and a category id, which links it to its category.
The subsection table has a subsection id and a section id, which links it to its section.
(all categories, sections and subsections also have names).
I need to make a menu appear on my website in the following format... (only one category, and hence half the sections and subsections, can be displayed at once)
Category 1
Section 1
Subsection 1
Subsection 2
Subsection 3
Section 2
Subsection 4
Subsection 5
Subsection 6
Section 3
Subsection 7
Subsection 8
Subsection 9
Is there a way to get all this information with only one select statement and display it as desired using some fancy php looping?
Is there a better way to do this?
Thanks
Kefka