Solved

PHP: Multiple Repeat Regions from 1 Recordset

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
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…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

919 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

22 Experts available now in Live!

Get 1:1 Help Now