PHP: Get all Childs, Sub Childs, Sub sub child Nodes… of a given Parent node


my Software Development Factory

Hello, I today while developing a system, a stage came when i needed to find the child nodes of a given parent node. at first i looks simple but actually it isn’t. You can understand the siuation well by taking an example of a joint family where one grand father lives with his all children in a house and all those children have their own children living in the same house and so on. And the question is ” How to find all the children (complete sub tree) of a specific father” ?

Here i have developed a way for you to do this. Actually i have a table structured as all the children and parents exist in the same  table having their own parent ID’s(if children) and no Parent IDs(if Parents). So when you want to find all the child nodes and we do not know the level of…

View original post 234 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s