Number of records shown per page


#1

A script lists 9 records per page instead of 10. I am unable to put my finger on the right variable. I have tried few alteration, but none worked.

[code] // Get query without limiting to current page
$sql->query($query);

    $num_rows = $sql->nr();
    
    
    $q_start_rec = ($s_page - 1) * 10;
    if ($q_start_rec < 0) $q_start_rec = 0;
    $query .= "LIMIT " . $q_start_rec . ", " . $s_records;

    
    $query .= ";";

    // Limit results to current page only
    $sql->query($query);

    if ($s_debug) {
        echo ("<textarea rows=10 cols=80>$query</textarea>");

?>


Found: <? echo ($num_rows); ?> records
<? if (!$s_page) $s_page = 1; $Number_of_Pages = (int)(($num_rows / $s_records) + .99999999999); if ($s_debug) echo ("Number_of_Pages = $Number_of_Pages
"); Page_Navigator($s_page, $Number_of_Pages, $s_string, true); ?> <? while ($sql->next()) { $row = $sql->record; $cn = 0; $ft = 0; $x++; if(($x < $BreakLoop)) continue; //if( ($BreakLoop==$s_records)&& $x>$s_records)break; if($x + 1 > ($BreakLoop + $s_records)) { break; } //echo $x; if($ev) echo "
"; $ev++; //echo $c."
"; [/code]

#2

Well, I don’t see where this gets set but it looks like $s_records is where it gets limited.

Also are you sure there are more than 9 records?


#3

If there are less than 10 records, all the records are shown, and if there are more than 10 records, 9 will show per page. However, when there is 10 records, 9 will show on the first page with no generation of a second page.

In any event, this is part of a more than 1000 lines code page and is difficult to diagnose. While I have not resolved the issue, I worked around the problem satisfying the client’s demand.

Thank you for all who have attempted to help in this matter.

Best,
Charles