I was wondering what would be the logic to display all categories and sub-cat and sub-sub categories and so on using PHP and MySQL?
A brief example would be very helpful thanks.
Here is my MySQL database structure.
id  parent_id   category                            url                                             depth
2   0           Arts & Ent                      ?cat=arts-and-entertainment                0
4   0           Automotive & Trans              ?cat=automotive-and-transportation         0
6   0           Business & Finance              ?cat=business-and-finance                  0
 
     
     
    