Hi.... i am making a quick guestbook for my site, but i am having trouble getting the 'display next 10 results" feature to work. I have made it so the query extracts the first 10 entries successfully, but i cannot get it to display the rest on other pages. Any suggestions?? The code i have made is below. Any suggestionsd would be great.
Jonathan
<?php
$DBhost = "localhost";
$DBuser = "**";
$DBpass = "";
$DBname = "****";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
mysql_select_db ($DBname);
$result = mysql_query("SELECT id, name, email, location, how, comments FROM guestbook ORDER BY id LIMIT 0, 10");
if(sizeof(mysql_num_rows($result)) == 0) {
echo "0 results";
}
while($values_ar = mysql_fetch_array($result))
{
// enter the display text here
echo "Name: $values_ar[name]<br> ";
echo "Email: $values_ar[email]<br> ";
echo "Location: $values_ar[location]<br> ";
echo "How did you find our site?: $values_ar[how]<br> ";
echo "Comments: $values_ar[comments]<br><br> ";
}
echo "<br> ::
<a href='http://www.*****.com/guestbook/index.php'>Next 10 Entres >></a>";
?>
------------ end-----