$sql = 'SELECT topic_id FROM '.POSTS_TABLE.' WHERE post_id="'.$postreport.'"';
if( !($result = $db->sql_query($sql) ))
message_die(GENERAL_ERROR, "Couldn't get post subject information");
$post_details = $db->sql_fetchrow($result);
$post_topic_id=$post_details['topic_id'];
$sql = 'SELECT pt.post_subject FROM '.POSTS_TEXT_TABLE.' pt, '.POSTS_TABLE.' p WHERE p.topic_id="'.$post_topic_id.'" AND pt.post_id=p.post_id ORDER BY p.post_time ASC LIMIT 1';
if( !($result = $db->sql_query($sql) ))
message_die(GENERAL_ERROR, "Couldn't get topic subject information".$sql);