Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Alfonso Florio on Aug 07, 2008 12:36
open dhtmlx forum
dhtmlxTree + dhtmlxDataProcessor + mysql ... how to get the PROPER order of all the items

I am using your tree for a project and is simply amazing.
I have ONLY one question, that is smashing my head:
I am using your example that saves the tree structure into a mysql database.

How can I THEN retrieve all the structure in the proper order? Can you suggest me an algorythm?

For proper order I mean displaying all the nodes and subnodes in the same sequence I can see in the tree.

I have only the order_id and the item_parent_id and I can't figure how to do. With a simple SELECT it doesn't work.

Thanks for any help




Answer posted by Support on Aug 08, 2008 01:44
If you are using such data structure ( parentId and orderId ) it can't be done with single call. - you can create a function which selects data for single level and call it recursive.

function show_data(){
      $childs=get_tree_level(id);
      foreach ($child as $child_id);
          show_data($child_id);
}