Kai: php mysql count

Beitrag lesen

Hallo liebe Leute im Forum, folgende Problematik, ich versuche die Anzahl an Kommentaren aus einer mysql Datenbank nach einem bestimmten Wert zu Zählen, hier $bid nur scheiter ich zur Zeit kläglich, hier mal mein Versuch, wobei der untere Teil wohl von mehr Bedeutung ist:

<?php
$res = mysql_query ("SELECT  bid, autor, content,thema, stamp  FROM blog_index");
$num = mysql_num_rows($res);
echo mysql_error();
for ($i=0; $i<$num; $i++)
   {  $bid = mysql_result($res, $i, "bid");
      $autor = mysql_result($res, $i, "autor");
      $thema = mysql_result($res, $i, "thema");
      $content = mysql_result($res, $i, "content");
      $stamp  = mysql_result($res, $i, "stamp");
      $datum = date("d.M.Y",$stamp);
      $uhrzeit = date("H:i",$stamp);

echo"<h1>$thema&nbsp<span>$autor&nbsp | &nbsp $datum &nbsp $uhrzeit</span></h1>";
    echo nl2br ("<p>$content</p>");
    echo"<p><a href="content_comment.php?bid=$bid">Kommentar</a></p>";

$res = mysql_query ("COUNT(bid) FROM blog_comment WHERE bid = '$bid' GROUP BY bid");
    $row = mysql_fetch_row($res);
    echo $row;
   }
?>