Load tree from SQL

Hello,

I am trying to populate a tree with multiple levels from SQL using connector but I am obviously doing something wrong because I only get 1 level.

Like this:

--Level 1a
-----Level 2
--Level 1b
--Level 1c
--Level 2
-----Level 3
--Level 3
-----Level 4
--Level 4
-----Level 5a
-----Level 5b
-----Level 5c

My data is like this:

ID,Node,ParentNode,Display Text

1,1,0,Root 
2,2,1,Level 1a
13,20,2,Level 2
14,300,20,Level 3
15,4000,300,Level 4
20,5000,4000,Level 5a
21,5001,4000,Level 5b
22,5002,4000,Level 5c
6,3,1,Level 1b
7,4,1,Level 1c

Is it possible to fill the tree using the connector or do I have to construct XML from my data?

Thank you

Hello,

am trying to populate a tree with multiple levels from SQL using connector but I am obviously doing something wrong because I only get 1 level.

make sure that you have defined the parent parameter (5th):

$tree->render_table(“table name here”,“ID”,“Display Text”,"",“ParentNode”);

Thanks a lot for your reply.

The mistake was that I used TreeGroupConnector instead of TreeConnector.

And also set my very first item to parentnode 0.