Tree data structure in php
Posted
by Piyush
on Stack Overflow
See other posts from Stack Overflow
or by Piyush
Published on 2010-05-26T07:21:04Z
Indexed on
2010/05/26
7:31 UTC
Read the original article
Hit count: 181
php
|datastructures
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??
© Stack Overflow or respective owner