while($tag = mysqli_fetch_assoc($result))
{
$arrayresult[$tag['id']][$tag['name']] = $tag['count'];
}
the $result contains 4 rows from database table.
i want it to be like:
$arrayresult[1]['mac'] = 34
$arrayresult[22]['pc'] = 32
$arrayresult[31]['windows'] = 14
$arrayresult[4]['linux'] = 23
the code above doesnt seems to work because it just return ONE element. seems that it saves over the preceding one.
how should i do it?
EDIT: the print_r says
Array ( [4] => Array ( [linux] => 23 ) )