All pastes #34049 Raw Edit

Unnamed

public text v1 · immutable
#34049 ·published 2005-12-18 12:45 UTC
rendered paste body
<?php										
	include 'include/template_top.php';										
	
	$result=$db->query("select * from shifts");
	
	echo "<br><br>";
	$buffer=$result;
	while($row=$buffer->fetchRow()){
		echo "<br>shift: $row[sh_id]";
	}
	
	echo "<br><br>";
	$buffer=$result;
	while($row=$buffer->fetchRow()){
		echo "<br>shift: $row[sh_id]";
	}
	
	echo "<br><br>";
	$buffer=$result;
	while($row=$buffer->fetchRow()){
		echo "<br>shift: $row[sh_id]";
	}
	
?>				


problem - only the first loop prints anything. I can't seem to be able to loop those result rows more than once. I have played with reset(), but not had any joy.