You are here: Re: rather noob trouble w/ tree expanding « PHP Programming Language « IT news, forums, messages
Re: rather noob trouble w/ tree expanding

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('&nbsp;&nbsp;',$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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация