我有一个问题,我想根据类型计算值..例如
a 5
a 5
b 7
输出:a = 10 和 b = 7,每次数据更改为 c,...,z 时,它都会计数++,这就是我到目前为止所得到的...
while ($row = mysql_fetch_array($result)) {
$num = $num+1;
echo "there are ".$row['COUNT(data)']." on ".$row['date']." items";
$total+= $row['COUNT(date)'];
?>
<? echo "<br/>";
}
echo "<br/> the data has " . $total ;
?>