display child filed
Posted: Sun Oct 08, 2006 7:19 pm
Hello,
I have a question about displaying a table in a recursive way. Not shure if I express my self corectly so sorry for that and for my bad english, but I hope you will understand
for example I have the folloeing table:
[table]
id int(5) auto_increment
category_name varchar(15)
parent_id int(5)
and this is tha data it contains
1 | Top category | 0
2 | Cars | 1
3 | Old cars | 2
4 | New cars | 2
5 | Computers | 1
6 | Used computers | 5
7 | Used Monitors | 6
This should be displayed like this in html
Cars
> Old cars
> New cars
Computers
> Used Computers
>> Used monitors
Any ideeas how could I do that?
Thx
I have a question about displaying a table in a recursive way. Not shure if I express my self corectly so sorry for that and for my bad english, but I hope you will understand
for example I have the folloeing table:
[table]
id int(5) auto_increment
category_name varchar(15)
parent_id int(5)
and this is tha data it contains
1 | Top category | 0
2 | Cars | 1
3 | Old cars | 2
4 | New cars | 2
5 | Computers | 1
6 | Used computers | 5
7 | Used Monitors | 6
This should be displayed like this in html
Cars
> Old cars
> New cars
Computers
> Used Computers
>> Used monitors
Any ideeas how could I do that?
Thx