private static function RecursiveMakeNode($row) { $returnVal = '"id":"' . $row["ColumnID"] . '", "text":"' . $row["colName"] . '", "fieldName":"' . $row["fieldName"] . '",'; $dt = parent::runquery("select * from rp_columns where parentID=" . $row["ColumnID"]); if (count($dt) != 0) { $returnVal .= '"children":['; for ($j = 0; $j < count($dt); $j++) { $returnVal .= "{" . ReportGenerator::RecursiveMakeNode($dt[$j]) . "},"; } $returnVal = substr($returnVal, 0, strlen($returnVal) - 1) . "]"; } else { $returnVal .= '"leaf":true'; } return $returnVal; }