Posted by Milan Krejci on 03/10/07 15:12
the thing is that descentant branches i dont want to expand do expand.
$id variable contains an array of branches i want the program to go
through (alcohol's id -> beer id etc)
function tree_list($parent, $level,$id) {
// retrieve all children of $parent
$result = mysql_query('SELECT cname,cid FROM kategorie '.
'WHERE parent="'.$parent.'";');
while ($row = mysql_fetch_array($result)) {
echo str_repeat(' ',$level).$row['cname']."<br/>\n";
if ($row['cid']==$id[$level])
$this->tree_vypis($row['cid'], $level+1);
}
}
[Back to original message]
|