<div id="title">news</div>
<center>
<table cellpadding="0" cellspacing="0" width="511px">
<?php $dbh = mysql_connect ("localhost", "eclecti_site", "eclectic") or die (mysql_error());
mysql_select_db ("eclecti_site");

$query = "SELECT * FROM `news` WHERE `ID` = " . $news . " ORDER BY `DATETIME` DESC LIMIT 1";
$mysql = mysql_query ($query, $dbh);
$entry = mysql_fetch_assoc ($mysql); ?>
	<tr><td class="subject"><b>Subject: </b><?php echo $entry [SUBJECT] . "</td><td class='date'><b>Date: </b>" . $entry [DATETIME] . "</td></tr>"; ?>
	<tr><td colspan="2" class="entry"><?php echo $entry [ENTRY]; ?></td></tr>

<?php $query2 = "SELECT * FROM `comments` WHERE `NEWS` = " . $news . " ORDER BY `DATETIME` ASC;";
$mysql2 = mysql_query ($query2, $dbh);
?>
			<tr>
			<td colspan="2"><br><div id="title">comments</div></td>
			</tr>
			<tr>
<?php
if (mysql_num_rows ($mysql2) > 0) {
	for ($x = 0; $x < mysql_num_rows ($mysql2); $x++) {
	$comment = mysql_fetch_assoc ($mysql2); ?>
			<tr><td colspan="2">&nbsp;</td></tr>
			<td class="subject"><b>Author: </b><a href="<?php echo $comment [HOMEPAGE];?>"><?php echo $comment [AUTHOR] . "</a></td><td class='date'><b>Date: </b>" . $comment [DATETIME] . "</td></tr>"; ?><tr><td colspan="2" class="centry"><?php echo $comment [ENTRY]; ?></td></tr><?php
	}
}
else {
	echo "<tr><td colspan='2' style=\"border-top:2px solid #000;border-bottom: 2px solid #000;text-align: center;\">No comments for this entry</td></tr>";
} ?>
	<tr><td colspan="2" class="date"><?php echo "<a href=\"?page=comment&news=" . $news . "\" title=\"Add your own comment\">Add a comment</td></a></td>";?></td></tr></table><br><br><br><br></center>