我有这个 SQL 代码,它从表中选择行并按类别列将它们组合在一起
echo '<strong>Categories</strong><br>';
$sql="SELECT * from tickets where deleted = '' and DAY(datetime) = '04' and MONTH(datetime) = '".date("m")."' and YEAR(datetime) = '".date("Y")."' group by category order by datetime ASC ";
$rs=mysql_query($sql,$conn);
while($result=mysql_fetch_array($rs))
{
echo $result["category"].' ('.mysql_num_rows($rs).')<br>';
}
显示行数时,每行显示相同的数字。
我怎样才能让这个在每个“类别”旁边显示正确的数字?