Re: [PHP] Newbie Q: Fetching vs. Looping

2002-06-29 Thread Duncan Hill
On Sat, 29 Jun 2002, Chris Shiflett wrote: > Duncan Hill wrote: > > >Is a free required for every query? Or can I go connect, query, query, > >query, free, close? > > > > You never have to free your results if you don't want to. As I > understand it, doing so simply frees up the memory that

Re: [PHP] Newbie Q: Fetching vs. Looping

2002-06-29 Thread Chris Shiflett
Duncan Hill wrote: >Is a free required for every query? Or can I go connect, query, query, >query, free, close? > You never have to free your results if you don't want to. As I understand it, doing so simply frees up the memory that is being taken up by the result set ($result in most exampl

Re: [PHP] Newbie Q: Fetching vs. Looping

2002-06-29 Thread Duncan Hill
On Sat, 29 Jun 2002, Chris Shiflett wrote: > 2) if not, try very specific queries that retrieve just the data you need, > and carefully free all results as you finish - also try to use persistent > connections if you forsee your site being under heavy load. Something I haven't picked up in my re

Re: [PHP] Newbie Q: Fetching vs. Looping

2002-06-29 Thread Chris Shiflett
Jed Verity wrote: >In general, is it faster and more efficient to query a MySQL database once with >a large SQL select statement and then loop through the huge resulting table? >Or does it make better sense to perform a number of smaller queries with >smaller resulting tables? > This is a hard qu

RE: [PHP] Newbie Q: Fetching vs. Looping

2002-06-29 Thread John Holmes
Depends what you're after. Your query should always return exactly the data you are after. Your tables should be arranged so that is possible. ---John Holmes... > -Original Message- > From: Jed Verity [mailto:[EMAIL PROTECTED]] > Sent: Saturday, June 29, 2002 5:10 PM > To: [EMAIL PROTECT