Tree data structure in php
- by Piyush
in my application user starts a new tree or get added under a child-user and keep on adding users in branches in such a way-
>there are 10 level of tree type structure.
>root node contain 1 user and each node(user) can have max 5 child-user in this way tree will be like level 0 = 1 user ,
level 1 = 5 user,
level 2 = 25 user ,
level 3 = 125 user and so on.
I created one MySQL table having columns like-
User_id , level, super_id, child1_id, child2_id, child3_id, child4_id, child5_id
my question is How can I get all child-user(child to child also) of a particular user at any level do I need to add some more columns in my table??