
June 18th, 2000, 06:07 PM
|
|
Junior Member
|
|
Join Date: Jun 2000
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I need to divide up the messages of the Guestbook I made into more pages. I mean: I want to display 10 mexs per page.
I prepared a counter which displays 10 mexs per page... but I don't know how to display the 2nd page (mex 11-20), 3rd (mex 21-30)etc...
PLEASE, GIVE ME A SOLUTION! I paste the code of my guestbook with counter here under:
<?php
require("db_mysql.inc");
class TQ_DB extends DB_Sql {
var $Host = "mysqldb.thinkquest.org";
var $Database = "C001515";
var $User = "C001515";
var $Password = "*******";
}
$getGuests = new TQ_DB;
$getGuests->query("SELECT * FROM Guest");
echo "There are ".$getGuests->num_rows()." messages in our guestbook:";
echo " 10 are displayed now";
print "<br>";
print "<br>";
$count=0;
while($getGuests->next_record() && $count < 10){
$count=$count+1;
print "<table width="75%" border="1" cellspacing="0" cellpadding="0">";
print "<tr>";
print "<td>";
echo "<p>Name: ".$getGuests->f("Name");
echo "<br>Date: ".$getGuests->f("DayTime");
echo "<br>City: ".$getGuests->f("City");
echo "<br>Country: ".$getGuests->f("Country");
echo "<br>Favourite Hero: ".$getGuests->f("FavouriteHero");
echo "<br>Comments: ".$getGuests->f("Comments");
print "</tr>";
print "</td>";
print "</table>";
}
?>
|