I'm having trouble with the paging section of a script that I've used successfully before.
Here's the site:
http://www.lissadesigns.com
Click on the 'Pansy' collection and then try the 'next' or '2' link at the bottom. It shows the correct variables passing through ($start, $num_results, and $num_pages), but it just shows the first 10 items again instead of the next nine that should show. Here's the paging section of the script:
// Make the links to other pages, if necessary.
if ($num_pages > 1) {
echo '<div align=center> <p>';
// Determine what page the script is on.
if ($start == 0) {
$current_page = 1;
} else {
$current_page = ($start/$display_number) + 1;
}
// If it's not the first page, make a Previous button.
if ($start != 0) {
echo '<a href="jewelrycollections.php?start=' . ($start - $display_number) . '&collectionname=' . $collectionname . '&num_pages=' . $num_pages . '&num_results=' . $num_results . ' ">Previous</a> ';
}
// Make all the numbered pages.
for ($i = 1; $i <= $num_pages; $i++) {
$next_start = $start + $display_number;
if ($i != $current_page) { // Don't link the current page.
echo '<a href="jewelrycollections.php?start=' . (($display_number * ($i - 1))) . '&collectionname=' . $collectionname . '&num_pages=' . $num_pages . '&num_results=' . $num_results . ' ">' . $i . '</a> ';
} else {
echo '<b><u> ' . $i . '</b></u>' . ' ';
}
}
// If it's not the last page, make a Next button.
if ($current_page != $num_pages) {
echo '<a href="jewelrycollections.php?start=' . ($start + $display_number) . '&collectionname=' . $collectionname . '&num_results=' . $num_results . '&num_pages=' . $num_pages . ' ">Next</a> ';
}
Any ideas why this isn't working correctly? http://www.lissadesigns.com