Solved

PHP: Multiple Repeat Regions from 1 Recordset

Posted on 2009-04-06
2
674 Views
Last Modified: 2013-12-12
I have a simple recordset that simply lists Record ID's and Record Names.

I want to repeat the same rows from the query in 2 or more separate places on the page.

However, if you try to initiate a second Repeat Region, an error is returned as the Recordset has looped through to the last record due to the first Repeat Region.

In ASP i can Requery the original Recordset so the database cursor is reset to the first record again. Maybe not the best practice, but it worked.

What is the best practice to over come this problem in PHP other than having 1 Recordset per Repeat Region?

Thanks
 
0
Comment
Question by:ticallian
2 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 24075240
Have you looked at http://www.php.net/manual/en/function.mysql-data-seek.php So the second time you want to process the record set use
mysql_data_seek($result, 0);
and then restart you fetches.
0
 

Author Closing Comment

by:ticallian
ID: 31566928
Thanks.
I had already tried that but must have had a typo as it failed.
Tried again and it worked fine.
 
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question