PHP Code:
$thread = $DB_site->query_first("SELECT thread.*,post.* FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid=thread.firstpostid)
WHERE thread.threadid=$threadid");
Instead of thread.*,post.* you can restrict it to the fields you really need.
So if you only want Author, Title, Date and Text this would be
Code:
thread.postusername, tread.title, thread.dateline, post.pagetext