samerhannoun Posted August 3, 2011 Share Posted August 3, 2011 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 More sharing options...
samgenius Posted August 3, 2011 Share Posted August 3, 2011 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 Regardsuse 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 More sharing options...
justsomeguy Posted August 3, 2011 Share Posted August 3, 2011 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 More sharing options...
samerhannoun Posted August 6, 2011 Author Share Posted August 6, 2011 thx all guys special thx : : justsomeguy Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.