This won't answer your whole question, but it will get you started I hope
<?php
if(!isset($viewPosts)) $viewPosts = 0;
$postsToDisplay = "10";
$query = "SELECT * FROM table ORDER BY id DESC LIMIT " . $viewPosts . ", " . $postsToDisplay . " ";
/*
* Do Database Connection
*
* Display your Posts or whatnot
*
*/
$query = "SELECT count(*) as count FROM table";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$numrows = $row['count'];
$pagenums = ceil ($numrows/$postsToDisplay);
if($viewPosts == "0") { $pageNowViewing = "1"; }
else{
$pageNowViewing = ceil ($viewPosts*$pagenums/$numrows);
}
if($viewNews > 0) {
echo "<a href=\"" . $PHP_SELF . "?viewNews=" . ($viewPosts - $postsToDisplay) .
"\" class=\"Link\"><<</a> ";
}
echo "<span class=\"text\">Page $pageNowViewing of $pagenums</span> ";
if($numrows > ($viewNews + $newsToDisplay)) {
echo "<a href=\"" . $PHP_SELF . "?viewPosts=" . ($viewPosts + $postsToDisplay) .
"\" class=\"Link\">>></a>";
}
?>
That should show something like this
Page 1 of 68 >>
if your on page one or
<< Page 27 of 68 >>
if your not
<< and >> being the links to move pages. nice lil code snippet from codewalkers.com that i modified a bit