I've never tried to do it with phpBB, but you basically need to have a script that handles making a connection to the database which you can include in your page code to grab the latest posts. You can make a connection with the following code:
PHP Code:
<?php
// The $conf array holds the configuration data for the db
$conf = Array('host' => 'real_host', 'user' => 'real_username', 'pass' => 'real_password', 'db' => 'real_database');
function connect() {
return mysql_pconnect($conf['host'], $conf['user'], $conf['pass']);
}
?>
And call it like this:
PHP Code:
<?php
$con = connect();
mysql_select_db($conf['db']);
?>
Then when you want to make a query:
PHP Code:
<?php
$sql = 'select * from post limit 5'; // You'll need to change this query to reflect the actual db structure.
$result = mysql_fetch_array(mysql_query($sql, $con));
echo '<pre>'; print_r($result); echo '</pre>';
?>
Obviously you'd have to write some sort of code to deal with connection failures, but that's pretty straightforward with php.net and a bit of googling.
This is nowhere near as object-oriented as it should be, I think, but it's easy to code and deal with.