Tree structuring - php coding

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sandipanmandaloffice
Forum Newbie
Posts: 1
Joined: Tue Feb 09, 2010 5:50 am

Tree structuring - php coding

Post 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
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: Tree structuring - php coding

Post 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.
Post Reply