I'm finding this hard to explain to know how to search for an answer for this. With the help of you lovely people yesterday I cut down ~1200 MySQl queries to just 2, but now I'm having trouble doing anything with the results. This is the array I'm getting back (snippet)
Array
(
[0] => Array ( [total] => 7 [closedby] => Adam_Howard [priority] => P3 [withinfix] => 0 )
[1] => Array ( [total] => 20 [closedby] => Adam_Howard [priority] => P3 [withinfix] => 1 )
[2] => Array ( [total] => 3 [closedby] => Adam_Howard [priority] => P4 [withinfix] => 0 )
[3] => Array ( [total] => 5 [closedby] => Adam_Howard [priority] => P4 [withinfix] => 1 )
[4] => Array ( [total] => 3 [closedby] => Adam_Jones [priority] => P3 [withinfix] => 0 )
[5] => Array ( [total] => 2 [closedby] => Adam_Jones [priority] => P3 [withinfix] => 1 )
[6] => Array ( [total] => 11 [closedby] => Adrian_Dimmock [priority] => P2 [withinfix] => 0 )
[7] => Array ( [total] => 39 [closedby] => Adrian_Dimmock [priority] => P2 [withinfix] => 1 )
[8] => Array ( [total] => 20 [closedby] => Adrian_Dimmock [priority] => P3 [withinfix] => 0 )
[9] => Array ( [total] => 301 [closedby] => Adrian_Dimmock [priority] => P3 [withinfix] => 1 )
[10] => Array ( [total] => 2 [closedby] => Adrian_Dimmock [priority] => P4 [withinfix] => 0 )
[11] => Array ( [total] => 33 [closedby] => Adrian_Dimmock [priority] => P4 [withinfix] => 1 )
[12] => Array ( [total] => 37 [closedby] => Adrian_Hull [priority] => P2 [withinfix] => 0 )
[13] => Array ( [total] => 1211 [closedby] => Adrian_Hull [priority] => P2 [withinfix] => 1 )
[14] => Array ( [total] => 4 [closedby] => Adrian_Hull [priority] => P3 [withinfix] => 0 )
[15] => Array ( [total] => 771 [closedby] => Adrian_Hull [priority] => P3 [withinfix] => 1 )
[16] => Array ( [total] => 4 [closedby] => Adrian_Hull [priority] => P4 [withinfix] => 1 )
)
The final output I'm working towards is the total number, per person, per priority, per withinfix, so for example, the last 2 lines could give a result like:
$AdrianHullP3Fix1 = 771;
$AdrianHullP4Fix1 = 4;
But I have no idea how to go about this from the results I have, can anyone recommend a solution or just the correct php method/function for me to investigate?
If it helps, this is the code I'm using to create the array from the query:
while($row = mysql_fetch_assoc($Query)){
$results[] = $row;
}
closedby,priorityandwithinfix) and I want to give it a value of thetotal