<?php
/*
This file will extract the comments the corresponding to the posts. 
Signature that will pass will be post id. It will pring comments along with 
owner of the comment and timestamp. 
*/
include("mysql_login.php");
echo "<h3>Comments </h3>";
$read_comment = "SELECT * FROM comment where postid = $user_post_result_row[postid] ORDER BY `date_created` DESC";
$read_comment_result = mysql_query($read_comment);
	while($result_comment_row = mysql_fetch_array($read_comment_result))
			{
				echo "<br>";
				echo "<b>Subject: ". $result_comment_row['subject'] . "</b><br>";
				echo $result_comment_row['body'] . "<br>";
				echo  "Date: " . $result_comment_row['date_created'];
				/*Find the user who submitted the comment
				*/
				$authen_user_comment = mysql_query("SELECT * FROM user where identification = $result_comment_row[identification]")or die ("Cant not query User"); 
				$authen_user_result = mysql_fetch_array($authen_user_comment);
				echo "<br> Submitted by: $authen_user_result[username]";
				echo "<br>";
			}
?>
