Re: Objects as array key names??
| From: | Robert Cummings | Date: | Sun, 16 Mar 2008 19:10:46 +0000 |
| Subject: | Re: Objects as array key names?? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271663@lists.php.net to get a copy of this message | ||
On Sun, 2008-03-16 at 11:42 -0700, Jim Lucas wrote:
> Robert Cummings wrote:
> > Imagine 200 customers in your example... your example will hit the DB
> > 201 times. The above hits the DB twice.
>
> My code was intended to get the concept across. Thanks for the
> suggestions though.
Ah, ok. I've inherited projects in the past where the kind of code you
showed was defacto... except the number of queries made to render a
homepage wasn't 201 it was thousands. In one case someone built a
category pullout menu that was generating close to 18000 queries. That
holds my record for inefficient DB queries.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP