<?php
function getChild($parent) {
//if $parent = child in database, print result
$result = mysql_query("SELECT a., b. FROM tblDependency a, tblFunction b WHERE a.ParentId = a.childId AND a.ChildID = b.FunctionID AND a.parentId = '$parent'");
if ($row1 = mysql_fetch_array($result)) {
print $row1["b.FunctionName"];
}
//else print parent name, get set of childs and reloop the function
else {
$result = mysql_query("SELECT a., b. FROM tblDependency a, tblFunction n WHERE a.Parentid = b.FunctionId AND a.ParentId = '$parent'");
print $row2["b.FunctionName"];
$result3 = mysql_query("SELECT * fFROM tblDependency WHERE Parentid = '$parent'"); //get sets of childs
do {
getChild($row3["childid"]);
} while ($row3 = mysql_fetch_array($result3));
}
}
?>
the code above is use to read multiple level of sub-function in database.
It return DLL error as below:
"Php has caused an error in PHP4TS.DLL
Php will now close."