<?php
// Input your connection to your database.
$query = "select max(id), message from entry limit 0, 100";
$result = mysql_query($query) or die("Error selecting newest message.");
while(list($id, $message) = mysql_fetch_row($result))
{
print("$id, $message");
/ The above variables holds both the id ($id) and the newest message($message) from the database. That is only if, the information is submitted in least to highest order where highest is the most recent. /
}
// Close the connection.
?>