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):
1 2 3 | <?php do { ?> [HTML code block that is being repeated] <?php } while ($row_rsRecordset1 = mysql_fetch_assoc($rsRecordset1)); ?> |
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.
1 2 3 4 5 6 | <?php do { ?> [HTML code block that is being repeated] <?php } while ($row_rsRecordset1 = mysql_fetch_assoc($rsRecordset1)); mysql_data_seek($rsRecordset1, 0); //resets recordset pointer $row_rsRecordset1 = mysql_fetch_assoc($rsRecordset1); //selects the first row of recordset ?> |