>
>


>

"; } // how many rows do we have in the recordset? $query = 'SELECT COUNT(id) AS totnumrows FROM tbl_main '.$_SESSION['sql_where']; $result = mysql_query($query) or die('Error, count query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $totnumrows = $row['totnumrows']; // how many pages do we have when using paging? $maxPage = ceil($totnumrows/$rowsPerPage); $self = $_SERVER['PHP_SELF']; // create the 'previous' and 'next' links plus 'first page' and 'last page' links // only show if at least 1 page returned if ($maxPage > 0) { // print 'previous' link only if we're not on page one if ($pageNum > 1) { $page = $pageNum - 1; $prev = " [<] "; $first = " [<<] "; } else { $prev = ' [<] '; // we're on page one, don't enable 'previous' link $first = ' [<<] '; // nor 'first page' link } // print 'next' link only if we're not on the last page and if there is more than one page if (($pageNum < $maxPage) && ($maxPage > 1) && ($pageNum > 0)) { $page = $pageNum + 1; $next = " [>] "; $last = " [>>] "; } else { $next = ' [>] '; // we're on the last page, don't enable 'next' link $last = ' [>>] '; // nor 'last page' link } // print the page navigation link echo "

".$first . $prev . " Showing page $pageNum of $maxPage " . $next . $last; mysql_close(); } } ?>




credits | forum

Cat No. Title Format Publisher Year Country Image Notes
click"; } else { echo ""; } ?>