You are here: Re: [PHP] Recursion: Ugh! « PHP « IT news, forums, messages
Re: [PHP] Recursion: Ugh!

Posted by Steve Brown on 05/26/05 21:46

> Food:Fruit:Red
> Food:Fruit:Green
> Food:Fruit:Yellow
> Food:Vegetables:Long
> Food:Vegetables:Round
> Food:Vegetables:Round:Spikey
> Food:Vegetables:Round:Smooth

How is your structure being built? Is it hard-coded or dynamic (e.g.
pulled from a DB)? We employ a similar "tree" structure for manging
items in our store front. Believe me when I say, its a hell of a lot
easier to only be concerned about the current item rathen then every
item in the sturcture. Consider that a 1-to-many relationship is much
easier to deal with than a many-to-many relationship. What I mean is,
if you are looking at the element "Round", don't concern yourself with
"Fruit" or "Long". Figure out your "upstream" path for the current
element, e.g. "Food:Vegetables" (which should be easy if you assume
that each element only has 1 parent). Then figure out the children
for the current element, e.g. "Spikey" and "Round". KISS. :)

 

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

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