RE: [PEAR] Trying to loop through MDB rowset -

From: Date: Thu, 07 Nov 2002 21:57:42 +0000
Subject: RE: [PEAR] Trying to loop through MDB rowset -
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2666@lists.php.net to get a copy of this message
Hi again Lukas, I've been thinking (ruminating) about this and have a solution (in my mind) about a way to satisfy this problem without having to touch MDB at all. What I don't like about the current way is that MDB loops through the results and then I have to loop through the results again to handle the data. Makes more sense to me to just loop once. I'll work on something and submit something to you - you can let me know if it looks reasonable. Give me a day or so. Matt Friedman Web Applications Developer www.SpryNewMedia.com Phone: 416 992 5482 Email: matt@SpryNewMedia.com > -----Original Message----- > From: Lukas Smith [mailto:smith@dybnet.de] > Sent: Thursday November 7, 2002 2:42 PM > To: 'Matt Friedman'; pear-general@lists.php.net > Subject: RE: [PEAR] Trying to loop through MDB rowset - > > > From: Matt Friedman [mailto:matt@sprynewmedia.com] > > Sent: Thursday, November 07, 2002 8:32 PM > > To: smith@dybnet.de; pear-general@lists.php.net > > Subject: RE: [PEAR] Trying to loop through MDB rowset - > > > > Thanks very much Lucas. > > > > Is loading up a new array with the whole result set ok (as in > queryAll)? > > I had actually thought that using the Resource Id instead of filling a > > result set object/array was more efficient. The impression I have is > > that using a result id uses less memory. What about large result sets? > > This may not be a big issue - I'm just throwing it out there. But > that's > > actually why I was trying to avoid using queryAll if I could. > > > > What about the ability to _not_ free the result so that you can > continue > > to loop through using the resource id when you use fetchRow etc...? > (via > > some flag or something?) > > > > Anyway, thanks again :) > > > > well hmmm ... > I ported this behavior from DB's get+() methods. > Recently there was the addition of autofree (automatically free a result > set when the end of the result set is reached). So maybe I shoud > re-examine this. Adding another flag is probably not a good idea because > most methods in MDB have so many parameters already due to the datatype > abstraction. > > Fetching everything at once will be faster I am quite sure as you have > less function calls. Then again you might be right that is uses more > memory. > > Regards, > Lukas > > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.general (#2666) next »