SELECT thread.title, post.pagetext, from_unixtime(thread.dateline) AS date FROM thread INNER JOIN post ON thread.firstpostid = post.postid