Hi there Everyone,

I currently have a dedicated Apache server with PHP 4.06, MySQL etc .. installed and 
running fine.  Below is alittle peice of code that I would love an answer to:


$connection = mysql_connect("Localhost","username!!!","password!!!") or die("Couldn't 
make a connection.");

$db = mysql_select_db("planet", $connection)
 or die("Couldn't select database.");

$sql = "SELECT id, email, name, subject, url, image2, comments, dat
        FROM users
        ORDER BY id DESC";

$sql_result = mysql_query($sql,$connection)
 or die("Couldn't execute query.");



while ($row = mysql_fetch_array($sql_result)) {
 $email = $row["email"];
 $name = $row["name"];
 $subject = $row["subject"];
 $url = $row["url"];
 $image2 = $row["image2"];
 $comments = $row["comments"];
 $dat = $row["dat"];

$ip = getenv ("REMOTE_ADDR"); 


then all the HTML and display bits (Example at www.planetoxygene.com in the guestbook).





Now my question is, how do I do paging in PHP?  I need to display 10 entries per page, 
and be able to go back and forth with them.  I'm relatively new to PHP so I would be 
really grateful for any advice.

Thanks everyone, I appreciate it.

Chris Payne

Reply via email to