Please Help. Search results wont display next page.
Posted: Wed Dec 01, 2010 3:45 pm
Hi I'm new to the site... and new to PHP, so excuse me if my verbiage isn't quite right. I've been struggling to find a solution to paging through my search results. MY code works for the first five entries that are found via the mysql query but when I click next five results, the code breaks down and sends me back to my index. I believe the problem is here in red:
// not last page so give NEXT link
$news=$s+$limit;
print " <a href=\"$PHP_SELF?s=$news&poster=$var\">Next 5 >></a>  ";
}
$a = $s + ($limit) ;
if ($a > $numrows) { $a = $numrows ; }
$b = $s + 1 ;
echo "<br />";
echo "<br />";
echo "<p>Showing results $b to $a of $numrows</p>";
}
If someone could help I would be so great full! Thanks in advance...
Code: Select all
$news=$s+$limit;
print " <a href=\"$PHP_SELF?s=$news&poster=$var\">Next 5 >></a>  ";
}
$a = $s + ($limit) ;
if ($a > $numrows) { $a = $numrows ; }
$b = $s + 1 ;
echo "<br />";
echo "<br />";
echo "<p>Showing results $b to $a of $numrows</p>";
}
Code: Select all