...
$result = mysql_query("SELECT * FROM forum WHERE category='$category' AND threadid='$thread' ORDER BY id DESC")
or die("SELECT Error1: " .mysql_error());
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
if ($i % 2) {
$bgcolor = "forumtable";
}
else {
$bgcolor = "forumtable2";
}
$id=mysql_result($result,$i,"id");
$author=mysql_result($result,$i,"author");
$contentwo=mysql_result($result,$i,"content");
$time=mysql_result($result,$i,"time");
$date=mysql_result($result,$i,"date");
$today = date("d/m/y");
if ($date == $today) {$date = "Today"; }
$content=nl2br($contentwo);
$query = mysql_query("SELECT * FROM forum WHERE author='$author'")
or die("SELECT Error1: " .mysql_error());
$posts=mysql_numrows($query);
include("includes/statuses.php");
echo "
<table width='100%' border='0' class='$bgcolor'>
<tr>
<td width='150px' valign='top'>
<a href='view_profile.php?profile_id=$id'>$author</a><br /><font color='#1616FF'>\"Registered user\"</font><br />
$status<br />Number of posts: $posts<br />$date at $time</td>
<td valign='top'>$content</td>
</tr>
</table>
<br />";
$i++;
}
...