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($pare nt, $level,$id) {
// retrieve all children of $parent
$result = mysql_query('SE LECT cname,cid FROM kategorie '.
'WHERE parent="'.$pare nt.'";');
while ($row = mysql_fetch_arr ay($result)) {
echo str_repeat('&nb sp; ',$lev el).$row['cname']."<br/>\n";
if ($row['cid']==$id[$level])
$this->tree_vypis($ro w['cid'], $level+1);
}
}
$id variable contains an array of branches i want the program to go
through (alcohol's id -beer id etc)
function tree_list($pare nt, $level,$id) {
// retrieve all children of $parent
$result = mysql_query('SE LECT cname,cid FROM kategorie '.
'WHERE parent="'.$pare nt.'";');
while ($row = mysql_fetch_arr ay($result)) {
echo str_repeat('&nb sp; ',$lev el).$row['cname']."<br/>\n";
if ($row['cid']==$id[$level])
$this->tree_vypis($ro w['cid'], $level+1);
}
}
Comment