Very good question from Laserlight...
I assume you store the messages in a MySql Database...
Then you would do something like this (after connecting to the database)
$query = "SELECT * FROM <tablename> ORDER BY <column that contains the date>";
$result = mysql_query($query);
if (!$result){die ("Error performing query " . mysql_error() );}
while ($row = mysql_fetch_array($result) ){
$name = $row["<column that contains the name>"];
$message = $row["<column that contains the message>"];
//and so on for each value that you want to retrieve from your database
//here you put your code, to display the results
} // because you're placing this within the while loop the script keeps on looping as long as there're rows in the database that were retrieved by your SELECT command.
This only applies when you store your stuff in a database. If it's stored in a file for example it's completely different...
Hope this helps...