Reset PHP Recordset for Multiple Repeat Regions

07 January, 2012 by Tom Elliott

Occasionally in your PHP application, you may need to have multiple repeat regions on one page using the same recordset. If you don’t reset the recordset after the first time you use a repeat region, the content in the second repeat region will appear blank.

For example, if the first repeat region looks something like the below (it probably will if you have added it using DreamWeaver):


 [HTML code block that is being repeated]

Then you can add the following code to reset the recordset pointer and select the first row. If you don’t select the first row of the recordset after resetting it, then you will probably get a blank line in your second or next repeat region.


    [HTML code block that is being repeated]

 



2 Comments

  • Ivars says:

    Perfect…had headache about this all morning 🙂 now it’s sorted..thank you

  • MAD says:

    I had a headache for 2 hours and now it is fine. Thank you!

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    css.php