You are here: Re: recursive function calling by reference « PHP Programming Language « IT news, forums, messages
Re: recursive function calling by reference

Posted by Chung Leong on 04/05/06 19:39

Stephanie Le Gall wrote:
> Hello,
>
>
> I'm using a recursive function to get an array of ID from a database passing
> the array by reference.
>
> I need this structure for the function because the database structure is
> like a tree and there is no limit of level.

Just a suggestion. Retrieving a tree from the database in the manner
you described can be expensive, since every nodes would trigger a
separate query. Usually what I do in a situation like this is to add a
column holding the id to the root of the tree, so that I could retrieve
all the rows at once. Then I use a recursive function to build the
tree.

 

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

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