On NETTUTS.com there's a (quite complete) tutorial posted that walks you through the creation of a forum using PHP and MySQL as a backend to store the posts.
In this tutorial, we're going to build a PHP/MySQL powered forum from scratch. This tutorial is perfect for getting used to basic PHP and database usage.
They start with the backend and move their way forward, setting up the MySQL tables - categories, replies, users and topics. They describe each of them in a bit more detail before getting into the code. They show how to create template for the site (with a little CSS) and include code to create users, authenticate them, set up their permission levels, making categories/topics and much more.
The full code for the forum application they've created can be downloaded here.