from my query sql get result like this :
btsname------date------dcr
aaaa---------jan01------0.2
aaaa---------jan02------0.3
aaaa---------jan03------0.4
aaaa --------jan04------0.5
.
.
bbbb---------jan01------1.1
bbbb---------jan02------1.2
bbbb---------jan03------1.3
bbbb---------jan04------1.4
.
.
i try to change result below
btsname ----jan01-----jan02-----jan03----jan04--
aaaa--------0.2-------0.3-------0.4-------0.5
bbbb--------1.1-------1.2-------1.3-------1.4
.
.
i try to make php like this
$resulthw=mysql_query($rs);
$n = array();
while($row = mysql_fetch_assoc($resulthw)){
if(!isset($n[$row[date]])){
$n[$row] = array(0,0,0,0,0,0,0,0,0,0);
}else{
$n[$row][0] += $row[0];
$n[$row][1] += $row[1];
$n[$row][2] += $row[2];
$n[$row][3] += $row[3];
$n[$row][4] += $row[4];
};
};
foreach($n as $key=>$val){
echo "$key ....val[0]...val[1]....val[2]....val[3]......val[4]<br>";
}
but not running
could you help me??
irfani