Show different MySQL rows within the same results
My problem is a little complex, so I will try to set it out as simply as possible for you!
I have a MySQL database that has two types of page entries:
type = TOP_PAGE or SUB_PAGE
page_order = 1-9
parent_page = list of top pages
content = page content
Therefore, the idea is that all top-level pages have a page order and all the sub-pages have a page order, and all the pages have what I have termed a 'parent page', which is their 'group' of pages. What I can't work out how to do is set these pages out in the correct menu structure, which has to be in the following order:
1. Top-level pages by page_order (1-9)
2. Sub-pages shown underneath each corresponding top-level page also shown by their respective page order (i.e. each group of sub-pages will have it's own 1-9 page order).
Any advice on whether this is possible would be greatly received.