Image

Imagedivineright wrote in Imagephp

I have a table of categories with this structure.

Main will always be 0 and all other categories will use that as its parent.

cat_id | cat_name | parent_id
0000     Main       0000
0001     Shoes      0000
0002     Clothes    0000
0003     Sneakers   0001
0004     Boots      0001
0005     T-shirts   0002
0006     Pants      0002



I want to print them out like this

Main

  • Shoes


    • Sneakers

    • Boots


  • Clothes


    • T-shirts

    • Pants





I want to be able to do this for N number categories in N number of categories. Could someone give me an idea of the routine to do this? You dont have to write the code, psuedo or english would be fine. I just cant seem to wrap my head around where to start.

Thanks