[nycphp-talk] DB resultset
Sol
sol2ray at yahoo.fr
Fri Jul 9 17:33:33 EDT 2004
It's not a huge resultset and I know how many I need
for the lifetime of the script.
The question is:
I don't want to make a different query each time.
But I was thinking since the resultset is already
stored in memory by the database server, isn't it a
wast of time to loop through it and store it in an
array?
--- Paul Reinheimer <preinheimer at gmail.com> wrote:
> If you can do some basic checking to determine the
> max number of
> records you will need, only grab that. Beyond that,
> I think that the
> best practice would be to get all the records you
> could need, then use
> them as needed. If you can guarantee that you won't
> need the same
> peice again, unset it.
>
> A caveat: If the result set includes some huge
> feilds, blobs or text
> feilds with tonnes of data, you may want to
> re-consider :).
>
>
> paul
>
>
> On Fri, 9 Jul 2004 12:59:57 -0700 (PDT), Sol
> <sol2ray at yahoo.fr> wrote:
> > Hi all!
> >
> > What to do in the following situation?
> >
> > while working with a database result set that I
> need
> > to use more than once. But I don't need the same
> > number of record each time. Should I get the whole
> > thing in an array or live it in the database
> result
> > handle and work with it.
> > Which one is the best practice?
> >
> > =====
> > Sol Tour�
> > PHPBTREE
> > http://phpbtree.com
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Address AutoComplete - You start. We
> finish.
> > http://promotions.yahoo.com/new_mail
> > _______________________________________________
> > talk mailing list
> > talk at lists.nyphp.org
> > http://lists.nyphp.org/mailman/listinfo/talk
> >
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>
=====
Sol Touré
PHPBTREE
http://phpbtree.com
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
More information about the talk
mailing list