Bin ich jetzt schon übermüdet oder warum funzt die Mysql Anfrage innerhalb der Schleife nicht?
PHP:
<?php
$topic_query = mysql_query("SELECT * FROM topics ORDER BY ID DESC");
while ($topic = mysql_fetch_array($topic_query)) {
?>
<TR>
<TD WIDTH=82% BGCOLOR="#A8BFCE" HEIGHT=28 VALIGN=TOP>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=100%>
<TR>
<TD WIDTH="20%">
<P><a href="view.php?s=<?=$PHPSESSID?>&topicID=<?php echo $topic['ID'] ?>"><?php echo $topic['TopicName'] ?></a>
</TD>
<TD WIDTH="20%">
<p><?php
echo $topic['datum'];
?>
</TD>
<TD WIDTH="20%">
<?php
echo $topic['name'];
?>
</TD>
<TD WIDTH="20%">
<?php
$query = mysql_query("SELECT * FROM posts WHERE TopicId = ".$topic['ID']."";
$res = mysql_num_rows($query);
echo $res;
?>
</TD>
<TD WIDTH="20%">
Test
</TD>
</TR>
</TABLE>
</TR>
</TD>
</TR>
<?php
}
?>