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 Kimmo Laine on 03/10/07 19:44

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 = mysql_query('SELECT cname,cid FROM kategorie '.
> 'WHERE parent="'.$parent.'";');
> while ($row = mysql_fetch_array($result)) {
> echo str_repeat('&nbsp;&nbsp;',$level).$row['cname']."<br/>\n";
>
> if ($row['cid']==$id[$level])
> $this->tree_vypis($row['cid'], $level+1);
> }
> }

Sorry but I don't understand what the problem is. There seems to be some
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. Try
reformatting the question. What exactly is the _problem_?

Btw: A noob using classes and recursion? A case of cut'n'paste coding?

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

 

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

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