Re: Simple DB_DataObject question...

From: Date: Sun, 04 Jul 2004 23:37:38 +0000
Subject: Re: Simple DB_DataObject question...
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13485@lists.php.net to get a copy of this message
You could make a copy of the DataObject before fetching and try using it later....I doubt that will work, though. You could do this: $objs = array(); while($my_obj->fetch()) { $objs[] = clone($my_obj); } Then loop through that array. On Sun, 4 Jul 2004 15:34:24 -0500, Joseph Szobody <php-newsgroup@signaturetechstudio.com> wrote: > Folks, > > I want to loop through a DB_DataObject.... > > while($my_obj->fetch()) { > // Do something > } > > ... then later on in the same script I want to loop through the object > again, starting from the beginning.... > > while($my_obj->fetch() { > // Do something else > } > > ... so of course I need to reset the dataset so that fetch() starts at the > beginning the second time. How do I do this? > > Joseph > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > !DSPAM:40e867d0126351304514803! > > -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin--

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