[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-general
Subject:    Re: [PEAR] How to display results multiple times?
From:       Brad Hubbard <brad () congosystems ! com>
Date:       2003-02-24 6:22:02
[Download RAW message or body]

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

-- 
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic