I have a problem that my display news page everytime it's refreshed seems to add a new blank/empty set of rows to the database so when it runs it shows the blank rows.
here's the code..
<?php
//include concections
include 'connect.php';
//script to display the news in html format or something.
$sql = "SELECT * FROM news ORDER BY id DESC LIMIT 0,5";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
?>
<body bgcolor="#000000">
<?php
while($row = mysql_fetch_array($result))
{
$topic = $row['topic'];
$author = $row['author'];
$date = $row['date'];
$news = $row['news'];
?>
<table width="600px" align="center" cellpadding="0" cellspacing="0">
<tr><td width="282" colspan="2"><div class="newstitle" align="center"><?php echo $topic; ?></div></td></tr>
<tr><td width="282" align="center" colspan="2"><div class="newsstory"><?php echo $news; ?></div></td>
</tr>
<tr><td width="202"><div class="newspublish">Posted by: <?php echo $author; ?></div></td>
<td width="202" ><div class="newspublish" align="right"><?php echo $date; ?></div></td></tr>
</table>
<br />
<br />
<?php
}
?>
</body>
<?php
}
else
{
echo "No rows returned!";
}
?>