i wish to print out this(a tree):
1 0
2 1
3 1
5 3
7 5
9 7
6 3
4 0
8 0
0 means that they are root. i'm not sure how to start. do i make them to arrays or do i loop. i don't know so i would really appreciate your help here.
Did you have a go at the code in the SitePoint article - it had a bunch of code you could make a start on? Basically you're going to need a recursive function - one that calls itself - in order to generate the tree of parents and children.