Question : Continue repeat region further down the page with php

Hello all,

I have a repeat region of 3 items which I want to break out of to put other content below and below that continue the repeat region for 3 more items... Closest I get is by resetting the recordset after closing the repeat region first time... But this just makes the second part of the repeat region display the first three items again... What must  I do to have the second repeat region starrt where the first left off?

I use the code below to reset the recordset...

WKR RV
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
<?php
do {  
?>Stuff to repeat here
<?php
} while ($row_bla = mysql_fetch_assoc($bla));
  $rows = mysql_num_rows($bla);
  if($rows > 0) {
      mysql_data_seek($bla, 0);
	  $row_bla = mysql_fetch_assoc($bla);
  }
?>

Answer : Continue repeat region further down the page with php

You need to just use break statement in your while loop.

Look up the logic of this code:


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
<?php
$query_Recordset_List = "SELECT * FROM table";

$Recordset_List = mysql_query($query_Recordset_List, $baglanti) or die(mysql_error());
$totalRows_Recordset_List = mysql_num_rows($Recordset_List);

$i = 0;

echo "First 3 items: "."<br /><br />";
while ($row_Recordset_List = mysql_fetch_assoc($Recordset_List))
{
	$i++;
	echo $row_Recordset_List['id']."<br />";
	if ($i == 3)
	{
		break;	
	}
}

if ($totalRows_Recordset_List > 3)
{
	echo "<br />Other items: "."<br /><br />";
	while ($row_Recordset_List = mysql_fetch_assoc($Recordset_List))
	{
		echo $row_Recordset_List['id']."<br />";
	}	
}
?>
Random Solutions  
 
programming4us programming4us