database structure
Table: Category
categoryID - Auto increment
parentID - refers to parent category stored in THIS Table
categoryName - self explanatory
Example Data
categoryID | parentID | categoryName
--------------------------
----------
---------
0 | -1 | Home
1 | 0 | Category 1
2 | 0 | Category 2
3 | 2 | Category 3
4 | 0 | Category 4
5 | 1 | Category 5
I've been struggling with this for weeks now. All I want to do is display the information as shown. I'm almost certain this will have to be some sort of recursive function. I just haven't been able to get it just right.
Home
>> Category 1
>>>>Category 5
>> Category 2
>>>> Category 3
>> Category 4
Start Free Trial