SarcasticDwarf
Diamond Member
I have a search script that displays the number of returned hits. At the top of every page it shows:
Results X - Y of a total of Z
The problem I have is it always says 0-50 on the first page, even when there are less than 50 results (the maximum number is correctly calculated).
The code to display is print "$listnext - " . ($listnext + $listlimit) .
The generating code is:
$surch = htmlspecialchars($_GET["item"]);
$listnext = $_GET["next"] or $listnext = 0;
$listlimit = 50;
Damned if I can figure out how to get the correct number to show when the value is less than 50. I can see where the problem is, I just don't know how to fix something like that.
Results X - Y of a total of Z
The problem I have is it always says 0-50 on the first page, even when there are less than 50 results (the maximum number is correctly calculated).
The code to display is print "$listnext - " . ($listnext + $listlimit) .
The generating code is:
$surch = htmlspecialchars($_GET["item"]);
$listnext = $_GET["next"] or $listnext = 0;
$listlimit = 50;
Damned if I can figure out how to get the correct number to show when the value is less than 50. I can see where the problem is, I just don't know how to fix something like that.