Heres a rough translation of the code, this assumes the following type database in MySQL.
The database is called 'my_blog_db' which contains a table called 'Entries' with two fields called 'entry_time' and 'entry_text'.
I know its a bit sloppy but i threw the translation together from the top of my head, I havn't tested it yet, still waiting for my new mobo before i sort out my test server, I hope it helps or gives you an idea of what you need. excuse the whitespacing, i didn't bother with it much since its only a snippet.
PHP Code:
<?php
$pagesize = 10 // max entries in each page.
$requestpage = $_HTTP_GET_VARS["page"]; // fetch the page the user wants to see.
// standard MySQL initalisation junk.
$conn = mysql_connect("host","user","password");
if(!$conn) die("Unable to connect to MySQL DB, Error: ".mysql_error());
$db = mysql_select($conn, "my_blog_db");
if(!$db) die("Unabled to select DB, Error: ".mysql_error());
$results = mysql_query($conn,"SELECT * FROM Entries;");
if(!$results) die("Query failed, Error: ".mysql_error());
// done with mysql stuff.
$entries = mysql_num_rows($results) / $pagesize;
if($entries > $pagesize) {
if(fmod($maxpages))
$maxpages = floor($maxpages) + 1;
} // calculated the maximum pages based on the number of entries you have.
else $singlepage = true;
mysql_field_seek($results,$requestpage); // move the pointer to the row for this page.
echo "<table>\n\t<td>\n";
for($i=0;$i++;$i>$pagesize) {
$array = mysql_fetch_assoc($results);
echo "\t\t<tr>Posted: ".$array["entry_time"]."</tr>\n";
echo "\t\t<tr>".$array["entry_text"]."</tr>\n";
} // throw out the specified ammount of entries.
echo "\t</td>\n</table>";
if($singlepage) die("listing done");
if($requestpage > 1) echo "<a href=\"./page.php?page=".$requestpage-1."\">Prev Page</a> | \n";
else echo "... \n";
for($i=0;i++;$i>$maxpages) {
echo "<a href=\"./page.php?page=".$i."\">".$i."</a> | \n";
}
if($requestpage < $maxpages) echo "<a href=\"./page.php?page=".$requestpage+1."\">Next Page</a>\n";
else echo "... \n";
mysql_free_result($results);
mysql_close($conn);
?>
*edit* fixed the syntax of the die() functions up top.