Breaking up a result set into batches
Posted: Fri Nov 14, 2008 9:15 am
Hi everyone,
I work with php and MySQL.
Im having a little challenge and need help.
After reading from the database, i want to display the results in an html table. so far, this is what ive done
problem with this is that it gets all the rows in the result set, but i want to be able to display a limited number of rows on a page and then include page numbers as clickable links. on clicking a link, i want to display another set of results and so on
I work with php and MySQL.
Im having a little challenge and need help.
After reading from the database, i want to display the results in an html table. so far, this is what ive done
Code: Select all
while($newArray = mysql_fetch_array($result3)){
$datee = $newArray[DATE] == null ? "-" : $newArray[DATE];
$pcfname = $newArray[PCFName] == null ? "-" : $newArray[PCFName];
$cellname = $newArray[CellName] == null ? "-" : $newArray[CellName];
$memberstrenght = $newArray[MemberStrenght] == null ? "-" : $newArray[MemberStrenght];
$totalattendance = $newArray[TotalAttendance] == null ? "-" : $newArray[TotalAttendance];
$nofirsttimers = $newArray[NoOfFirstTimers] == null ? "-" : $newArray[NoOfFirstTimers];
$newconverts = $newArray[NoOfNewConverts] == null ? "-" : $newArray[NoOfNewConverts];
$filled = $newArray[NoFilledWithHolySpirit] == null ? "-" : $newArray[NoFilledWithHolySpirit];
$offering = $newArray[TotalCellOffering] == null ? "-" : $newArray[TotalCellOffering];
$pioneers = $newArray[NoOfCellPioneers] == null ? "-" : $newArray[NoOfCellPioneers];
print "<tr><td>$datee</td><td width='100'>$pcfname</td><td width='100'>$cellname</td><td>$memberstrenght</td><td>$totalattendance</td><td>$nofirsttimers</td><td>$newconverts</td><td>$filled</td><td>$offering</td><td>$pioneers</td></tr>";
}