I am having trouble with a MySQL join query - unfortunately I am not too good with joins.
Table page_section:
-------------------
id
page_id
name
display_order
Table page_section_sub:
-----------------------
id
page_section_id
page_id
content
One page_section can have many page_section_sub
On my page I want to display rows from page_section_sub ordered by page_section.display_order
Currently I have this:
$query="SELECT * FROM page_section_sub WHERE page_section_id IN (1,2,3,4,5)
ORDER BY display_order";
But this is not working as it is missing the join. How do I do this?
select pss.* from page_section_sub pss join page_section ps on pss.page_section_id = ps.id where ps.id between 1 and 5 order by ps.display_order