I have a table that looks like:
What I want to do is output the main categories (those with null category_id) and under each one, list the categories that have that category_id as the parent. That way, I create a little hierarchy output.
I could do this simply by doing a query that grabs all of the categories with null parent. Then doing another query that finds the categories with that as its parent. However, I am confident there's a way to do this in PHP/MySQL with only one query.
Any help, even conceptually, would be greatly appreciated!