Jump to content

Database Tree Design


samerhannoun

Recommended Posts

Hi guys,, I have something need logical solution not coding issues, the problem is that I have data in tree structure eg:1.abcd a.efg 11.hij2.cvb a.fgh 22.hijand I need to display every thing in the right order, and know what the user is check?? if you note that point 11 = 22 So I need something to store the above parent in mind.'what can I do????????????thanks in advance for any help or ideaBest Regards

Link to comment
Share on other sites

Hi guys,, I have something need logical solution not coding issues, the problem is that I have data in tree structure eg:1.abcd a.efg 11.hij2.cvb a.fgh 22.hijand I need to display every thing in the right order, and know what the user is check?? if you note that point 11 = 22 So I need something to store the above parent in mind.'what can I do????????????thanks in advance for any help or ideaBest Regards
use implode to join... and when u fetch use explode to split..http://php.net/manual/en/function.implode.php
Link to comment
Share on other sites

The tree nodes should be stored in a table, where you also store the parent node ID. You'll need to use a recursive function to get the entire tree, so the function would first get all of the root nodes without a parent, and for each node it got it would run the function again to get the children for that node and append them, then get the children for each of those nodes, etc. A recursive function is a function that calls itself.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...