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

if (!empty ($news)) {
$query = "SELECT * FROM `news` WHERE `ID` = '" . $news . "' ORDER BY `DATETIME` DESC LIMIT 1";
$mysql = mysql_query ($query, $dbh);
for ($x = 0; $x < mysql_num_rows ($mysql); $x++) {
$news = mysql_fetch_assoc ($mysql); ?>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td class="subject"><b>Subject: </b><?php echo $news [SUBJECT] . "</td><td class='date'><b>Date: </b>" . $news [DATETIME] . "</td></tr>"; ?>
	<tr><td colspan="2" class="entry"><?php echo $news [ENTRY]; ?></td></tr>
<?php $query2 = "SELECT * FROM `comments` WHERE `NEWS` = " . $news [ID] . " ORDER BY `DATETIME` DESC;";
$mysql2 = mysql_query ($query2, $dbh); ?>
	<tr>
		<td class='subject'><?php echo "<a href=\"?page=readComments&news=" . $news [ID] . "\">" .mysql_num_rows ($mysql2) . " comments</a></td>"; ?>
		<td class='date'><?php echo "<a href=\"?page=comment&news=" . $news [ID] . "\" title=\"Add your own comment\">Add a comment</td></a></td>";?>
	</tr>

<?php } }
else { ?>
<tr><td colspan="2">No news entry selected</td></tr>
<?php } ?>
</table>
<center><br><br><br><br>