help w/pagination

1Tsme1941

Member
Hi, got a prob. My code works great except that it only displays 1 line. Please advise.
----------------------------------------------------------------------------------------
the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head><body><center>
<div class="display print">

<?php error_reporting (E_ALL ^ E_NOTICE);

// Include config file
require_once "getprerentdb.php";

//MySqli Select Query
$results = $mysqli->query("SELECT * FROM payfile");//Print version
//Set at what record to break at 25 records per page
$BreakAT=25;
$num=0;
$pagenum = 1;
$totpaid=0;
// ---------------------------------------
while($row = mysqli_fetch_array($results)) {
// ----------------------------------------
if($num % $BreakAT == 0)
{
if($num>0)

{ echo '</table class="print">';
echo '<div class="breakhere"></div>';
$pagenum++; }

echo date('m/d/y');
echo " Page " . $pagenum;
?>
<div class="title">Payment Report</div><br />
<table align="center" cellspacing=0 cellpadding=0 border=1>
<thead>
<tr>
<th>tenant</th>
<th>unit</th>
<th>rent paid</th>
<th>rent due</th>
<th>due date</th>
<th>prev bal</th>
<th>late chg</th>
<th>sec dep</th>
<th>damage</th>
<th>court cost</th>
<th>nsf</th>
<th>hud pay</th>
<th>tenant pay</th>
<th>date paid</th>
<th align=left>comment</th>
</tr>
</thead>
<?php
$totpaid += $row['paidsum'];
echo '
<tr>
<td>' . $row['tenant'] . '</td>
<td>' . $row['unit'] . '</td>
<td align=right class="currency">$'.number_format($row['amtpaid'],2).'</td>
<td align=right class="currency">$'.number_format($row['amtdue'],2).'</td>
<td>' . $row['duedate'] . '</td>
<td align=right class="currency">$'.number_format($row['prevbal'],2).'</td>
<td align=right class="currency">$'.number_format($row['latechg'],2).'</td>
<td align=right class="currency">$'.number_format($row['secdep'],2).'</td>
<td align=right class="currency">$'.number_format($row['damage'],2).'</td>
<td align=right class="currency">$'.number_format($row['courtcost'],2).'</td>
<td align=right class="currency">$'.number_format($row['nsf'],2).'</td>
<td align=right class="currency">$'.number_format($row['hudpay'],2).'</td>
<td align=right class="currency">$'.number_format($row['paidsum'],2).'</td>
<td>' . $row['datepaid'] . '</td>
<td>' . $row['comments'] . '</td>
</tr>';
$num++;
}
}
echo '
<tr>
<th scope="row" colspan="12">Total Paid:</th>
<td bgcolor="#FFD4D4" class="currency">' . number_format($totpaid, 2, '.', '') . '</td>
</tr>
</table>';

?>
</center></div></body></html>
 
Top