Hi Guys,
I have a table with all my categories and subcategories, with the following schema:
id_category | id_parent | name
1 | 0 | category#1
2 | 1 | subcategory#1
3 | 1 | subcategory#2
4 | 2 | subsubcategory#1
5 | 0 | category#2
5 | 5 | subcategory#3
...
All categories have id_parent = '0' and subdirectories have id_parent = the category or subcategory they belong to.
I want to do a simple query that displays categories and all it's nested subcategories in order.
Is it possible to do this with one query or must I make a loop to get them all?
Thanks.