Database Table: id, name, subcat;
Example Usage:
id - name - subcat
1 - A - 0
2 - B - 0
3 - C - 1
4 - D - 1
5 - E - 2
6 - F - 0
7 - G - 3
As you can see "A,B,F" are parent categories
"C and D" are sub-categories of "A" (example display in title of browser when visiting c would be "A -> C")
"G" is a subcategory of c. (example display in title of browser when visiting G would be "A -> C -> G")
How do I loop through all occurences like this?