Forum Moderators: coopster
With the script you see below, my results are listed, but the navigation (next, back) do not seem to work. I was hoping someone can look it over and tell me where I'm going wrong.
<?
$user="***********";
$password="************";
$database="*************";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
?>
<?
$increment = 3;
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
$query="SELECT * FROM countries WHERE country_category='europe' LIMIT ";
$query .= $page * $increment - $increment . ", " . $increment;
$result = mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Countries</center></b><br><br>";
while ($row = mysql_fetch_array($result))
{
echo '<a href="' . $row['country_link'] . '"target="_blank">' . $row['country_name'] . '<br /></a> ';
}
if($page > 1)
{
echo '<a href="' . $_SERVER['PHP_SELF'] . '?page=' . $page - 1 . '"> Back </a>';
}
echo '<a href="' . $_SERVER['PHP_SELF'] . '?page=' . $page + 1 . '"> Next</a>';
?>