Page 1 of 1

Tree structuring - php coding

Posted: Tue Feb 09, 2010 6:13 am
by sandipanmandaloffice
I have some difficulty during the development of some module:: Let me describe the same below::

DATABSE table Structure::
Image
Image


Here the "ID" in DB showed above in the table screenshot[SEE pics above].

And I need the Coding Logic from the same as

Image

here Number indicates the "ID" numbers Of DB table.


Spl Note:: I want to dispaly Level wise "ID", Means whcich id belongs to Which level, 1 member belongs to 1st level means he has 3 member as immidiate subordinate.

Plz help me out


Thank you

Re: Tree structuring - php coding

Posted: Tue Feb 09, 2010 7:09 pm
by JakeJ
Google 2-3-4 tree.

I've never had to do it so I can't really explain it.

From a database standpoint:

table_nodes;
id
name

table_tree:
child_id
parent_id (table_nodes.id)

What I don't know is how to traverse the tree programatically.