Archie + Gossip girl!
2011-01-05 08:22:42 UTC
I'm hoping to do what they did on the website where they show maybe the first three pages and the last three pages.. with dots in the middle to represent the middle pages. Below are my codes, I'd appreciate if you can guide me through on how to improve my current codes. Thanks!
// *** Setup pagination.
$sql = "SELECT * FROM public_subscribe";
$result = mysql_query($sql);
if (!$result) {
echo("
Could not get pagination information.");
} else {
$numRecords = mysql_num_rows($result);
$numPages = ceil($numRecords / $numRecsPerPage);
if ($numPages > 1) {
// *** Display pagination controls.
$prevControl = '' ;
$nextControl = '' ;
if($pageNum > 1) {
$prevPage = $pageNum - 1;
$prevControl =
"PREV";}
if ($pageNum < $numPages) {
$nextPage = $pageNum + 1;
$nextControl =
"NEXT";
}