I would like to know how you can display 10 entries at a time from the database. Once 10 entries have been shown a forward button must appear at the bottom of the results prompting the user to goto the next 10. On the second page of results a back button should appear and so on, I think you know what I mean. . I have copied and pasted the code from my page that gets the results from mysql database.
Here is my code:
<?php
$connection = mysql_connect ("domain_name","password", "user");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."<BR>";
exit;
}
$query = "select * from greatbritain";
$result = mysql_db_query ("name_db", $query);
if ($result){
echo "<center><img src=key.gif><br><br>";
echo "<center><img src=strip.gif><center><br>";
echo "<table width=20% border=0 cellpadding=0 cellspacing=0>";
$numOfRows = mysql_num_rows ($result);
for ($i = 0; $i < $numOfRows; $i++){
$country = mysql_result ($result, $i, "country");
$region = mysql_result ($result, $i, "region");
$towny = mysql_result ($result, $i, "towny");
$descy = mysql_result ($result, $i, "descy");
$tel = mysql_result ($result, $i, "tel");
$mobile = mysql_result ($result, $i, "mobile");
$email = mysql_result ($result, $i, "email");
$linky = mysql_result ($result, $i, "linky");
echo "<link rel=stylesheet type=text/css href=General.css>";
echo "<body bgcolor=#324F8F><tr><img src=country.gif align=absmiddle alt=country>$country</tr><tr><img src=region.gif align=absmiddle alt=region>$region</tr><tr><img src=town.gif align=absmiddle alt=town>$towny</tr><tr><img src=details.gif align=absmiddle alt=description of rental>$descy</tr><tr><img src=telephone.gif align=absmiddle alt=telephone number>$tel</tr><tr><img src=mobile.gif align=absmiddle alt=mobile number>$mobile</tr><tr>";
if ($email){
echo "<a href=mailto:$email><img src=email.gif border=0 alt=email></tr></a>";
}
echo "";
if ($linky){
echo "<a href=$linky target=_blank><img src=webpage.gif border=0 alt=website></a>";
}
echo "</tr><br><br><center><img src=strip.gif><br><br>";
}
}
mysql_close ();
?>