我想根据类型来计算值时, 出现问题 。 例如 :
a 5
a 5
b 7
the output: a = 10 and b = 7 and it will count++ every time the data change to c, ... , z this is what i got so far...
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 ;
?>