Hi php guru's out there..
just need a little help here with my paging code...okay the code below are the code what I have currently and it works great...
<?
[b]//on the top of my page[/b]
//////////////////////////////////////////////////////////////////////
include("dbconnect.php");
///////////////recordset////////////////////////////////////////////
//////FORMATTING RECORDSET///////////////
$rowsPerPage = 10;
$pageNum = 1;
if(isset($_GET['page'])){
$pageNum = $_GET['page'];
}//end if
$offset = ($pageNum - 1) * $rowsPerPage;
$query = "SELECT * FROM tshirt ";
$pagingQuery = "LIMIT $offset, $rowsPerPage";
$result = mysql_query($query . $pagingQuery) or die('Error, query failed');
/////////////////////////////////////////////////////////////////////
[size=18][b]//at the bottom page
[/b][/size]
$result = mysql_query($query) or die('Error, query failed');
$numrows = mysql_num_rows($result);
$maxPage = ceil($numrows/$rowsPerPage);
$self = $_SERVER['PHP_SELF'];
if ($pageNum < $maxPage){
$page = $pageNum + 1;
echo "<a href=\"$self?page=$page\">Next</a>\n";
}
echo "$pageNum of $maxPage";
if ($pageNum > 1 && ($pageNum <= $maxPage)){
$page = $pageNum - 1;
echo "\n\n\n<a href=\"$self?page=$page\">Previous</a>\n";
}
?>
So the code will paging like this...
next 1 of 5 previous ---->which is okay for a small amount of records
but is so annoying for a big amount record because the visitor has to click fo multiple times in order to navigate for particular record...imagine if I have a thousand record...??So what I after is is there possible I can alter my code so that I can output like this for a big amount record...
next 1 2 3 4 5 6 7 8 9 previous
hope someone will give me some shed on light on how to achieve it....
thanks in advanced
http://www.bundlecollections.net/paging/paging.zip