Solved

PHP: Multiple Repeat Regions from 1 Recordset

Posted on 2009-04-06
2
665 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now