Dismounted, I tried pasting the code into the php page (screenshot) the same place (beneath the START MAIN SCRIPT comment as I believe boofo did (when I looked at his info.php file), is that what u mean, cause its not working for me. I pasted this PHP code at line 37.
PHP Code:
// include MySQL connector function
if (! @include('includes/connection.inc.php')) {
echo 'Sorry, page unavailable';
exit;
}
$conn = dbConnect('query');
// how many rows to show per page
$rowsPerPage = 20;
// by default we show first page
$pageNum = 1;
// if $_GET['page'] defined, use it as page number
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
// how many rows we have in database
$query = "SELECT COUNT(ID) AS numrows FROM provider";
$result = mysql_query($query) or die('Error, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
// how many pages we have when using paging?
$maxPage = ceil($numrows/$rowsPerPage);
// print the link to access each page
$self = $_SERVER['PHP_SELF'];
$nav = '';
for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page "; // no need to create a link to current page
}
else
{
$nav .= " <a href=\"$self?page=$page\">$page</a> ";
}
}
// creating previous and next link
// plus the link to go straight to
// the first and last page
$last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> ";
}
else
{
$next = ' '; // we're on the last page, don't print next link
$last = ' '; // nor the last page link
}
// print the navigation link
echo "<p style='text-align:center'>".$first . $prev . $nav . $next . $last."</p>";