Problem in loading treegrid

Hi everybody

I need some help to find a solution to this problem.

I built a my sql view (queryTree) using a mysql function to pass a parameter.

If i build a temp table using this sql: SELECT * FROM (SELECT @COD:=1044654) parm, queryTree;

and then i use this table to populate the treegrid: $tree->render_table(“temptable”,“ID”,“DESCRIZIONE,VAL1,VAL2,VAL3,VAL4”, “”, “PARENT_ID”);
all runs correctly with fathers and children.

If instead, i use: $tree->render_complex_sql(“SELECT * FROM (SELECT @NDG:=1044654) parm, queryTree;”,“ID”,“DESCRIZIONE,VAL1,VAL2,VAL3,VAL4”, “”, “PARENT_ID”);

the treegrid is populated but with all records as fathers without children except for the first one that is the father of all Others records.

What il the problem ? in the query sintax ?

I specify that, in mysql, the contents of temptable and result of query are exactly the same.

Many thanks for help.

please help !

Please, make sure that your PARENT_ID field in your table have valid ids for your rows.
If the problem still occurs for you pleas,e provide a complete demo with the sql dumps of your data simulation.
Here you can find a tutorial about creating a complete demo:
docs.dhtmlx.com/tutorials__auxi … pport.html