<?
$query="SELECT topic, post FROM bb ORDER BY LAST_INSERT_ID() LIMIT 5";
$result=mysql_query($query);
$num=5;
$i=0;
while ($i < $num) {
$post=mysql_result($result,$i,"post");
echo "<center>";
$listquery = mysql_query("SELECT * FROM bb WHERE post='$post");
$row = mysql_fetch_assoc($listquery);
$post = $row['post'];
$topic = $row['topic'];
echo "<a href='thread.php?post=$post'> $topic </a> <br>";
++$i;
}
?>
I think that should work, I just made up variables and such so you will need to replace them. I also didnt debug it. It should give you a concept though.