|
Posted by Rik on 03/10/07 19:56
Kimmo Laine <spam@outolempi.net> wrote:
> Milan Krejci kirjoitti:
>> 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 =3D mysql_query('SELECT cname,cid FROM kategorie '.
>> 'WHERE parent=3D"'.$parent.'";');
>> while ($row =3D mysql_fetch_array($result)) {
>> echo str_repeat(' ',$level).$row['cname']."<br/>\n";
>> if ($row['cid']=3D=3D$id[$level])
>> $this->tree_vypis($row['cid'], $level+1);
>> }
>> }
>
> Sorry but I don't understand what the problem is. There seems to be so=
me =
> sort of recursive hierarchy tree structure involved but that's all I =
> get. Also it would be nice to know what the method tree_vypis does.
Also, what this mysterious $id does, and why it is not fed down the =
recursion like the rest.
> Btw: A noob using classes and recursion? A case of cut'n'paste coding?=
Nah, I made (local test-)server crashing recursions and classes the firs=
t =
week I used PHP :P
-- =
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel
[Back to original message]
|