Re: How to display results multiple times?
| From: | Brad Hubbard | Date: | Mon, 24 Feb 2003 06:22:02 +0000 |
| Subject: | Re: How to display results multiple times? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3905@lists.php.net to get a copy of this message | ||
On Fri, 21 Feb 2003 09:13 Australia/Melbourne, ASCII characters were aligned
thusly:
> Hi there. New to the list, so nice to meet you all :)
>
> I am trying to display the results of a query a few times on my page -
> in multiple pop-up menus that all contain the same list or results.
>
> It works fine the first time, but the others are empty. I assume that I
> need to 'rewind' before looping again, but I don't know how.
>
> Can anyone assist?
here's a question I posted on this very subject, on this very mailing list
almost a month ago that drew no responses. Read into that what you
will........
<SNIP>
terating over a result set is eaasy the first time;
while( $group_data = $result->fetchRow( DB_FETCHMODE_ASSOC ) )
{
blah.......
}
How come DB_Result doesn't have a reset() function so you can iterate over
the result set a second time without having to resort to this sort of thing?
for( $i = 0; $i < $result->numRows(); $i++ ) // Have to iterate through
// result set on the second pass
{
$group_data = $result->fetchRow( DB_FETCHMODE_ASSOC, $i );
blah......
}
</SNIP>
Brad