Possible Duplicate:
How can I convert a series of parent-child relationships into a hierarchical tree?
i'm working on a web application. and would like to make the navigation database driven. multilevel navigation, btw. now, the tricky part of it is, that i would like to use just one table. i looked, read and searched, but couldn't find a answer.
my table structure is
ID | NAME | LINK | ALC | PARENT_ID |
0 Home # 0 0
1 Ops # 0 0
2 ops1 # 0 1
3 ops2 # 0 1
and the question is how do i get the db content in an array so that i'm able to create the list tags with the subcategory
<ul>
<li>HOME</li>
<li>OPS
<ul>
<li>ops1</li>
<li>ops2</li>
</ul>
</li>
</ul>