I think you need something like this:
PHP Code:
while ($thread = $db->fetch_array($threads))
{
/////// add me
$comment = $db->query_first("SELECT pagetext FROM " . TABLE_PREFIX . "post where postid = ".$thread[lastpostid]."
LIMIT 1
");
// Do something with $comment[pagetext]
}
ETA ...but what this really does is show the last post from each of 10 threads (depending on the selected orderby).