I have some code outputting data into html tables. I'm trying to have a column that shows the total number of answers for that specific questions (defined by intQAID). Since $result is a query defined in the same php script, how can I run a second query to run a 'mysql_num_rows' on to calculate how many answers for the question?
$result = mysql_query("SELECT * FROM tblQA WHERE cCategory = 'Football' AND (TO_DAYS(CURDATE()) - TO_DAYS(dPostDateTime) < 1) ORDER BY dPostDateTime DESC, intQAID DESC");
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['intQAID'] . "</td>";
echo "<td>" . $row['cUsername'] . "</td>";
echo "<td>" . $row['dPostDateTime'] . "</td>";
echo "<td>" . Num of Responses . "</td>";
echo "<td><a href=answer.php?id=" . $row['intQAID'] . ">" . $row['cBody'] . "</a></td>";
echo "</tr>";
}
echo "</table>";