PinoyIto
Dec 6th 2006, 9:58 pm
I am trying to display a category three of my site, but I am having problem doing it. I heard that this can be accomplish in single sub query string.... I hope I can get help from here...
Here are some example of my data
ID CATEGORY_NAME PARENTID
1 Philippines 0
2 Abra 1
3 Bataan 1
4 Abucay 3
5 Balanga 3
6 Bangued 2
7 Pilar 3
8 Pilar 2
9 Bayan 7
I want to output them in tree format like this
Philippines
|__Abra
| |___Bangued
| |___Pilar
|__Bataan
|__Abucay
|__Balanga
|__Piliar
|__Bayan
Thanks in Advance
Here are some example of my data
ID CATEGORY_NAME PARENTID
1 Philippines 0
2 Abra 1
3 Bataan 1
4 Abucay 3
5 Balanga 3
6 Bangued 2
7 Pilar 3
8 Pilar 2
9 Bayan 7
I want to output them in tree format like this
Philippines
|__Abra
| |___Bangued
| |___Pilar
|__Bataan
|__Abucay
|__Balanga
|__Piliar
|__Bayan
Thanks in Advance