UserID parentID Position
1 0 0
2 1 0
3 1 1
4 3 0
5 3 1
here position can be 0 or 1 ..i.e 0 for left and 1 for right
Now the scenario is:
on current page lets assume i have a userID of a user in a string variable lets say 1 so what i am trying to do is i need to create a tree for that particular userID.
the way i am thinking we could achieve is -
first we will find out in that database all entries who have parentID as this userId( '1' in this case) so we will get list of nodes which are child to this userID
then will run this in recursion so that for each of that child will find out the tree ( there child's and so on)
once this tree on that userID( in a temporary database) is build i need to show this in graphical form...
for above data it should generate