Breaking up an array
| From: | Troy A. Delagardelle | Date: | Sat, 19 Jan 2002 10:32:54 +0000 |
| Subject: | Breaking up an array | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-15990@lists.php.net to get a copy of this message | ||
I am trying to break this array up so that I can display each one of these
varibles independantly. What PHP function will allow me to to this?? Or
what other way can I achieve this?? Thx Troy
+----------+-------+-----------------+---------+---------+
| username | Total | average | minimum | maximum |
+----------+-------+-----------------+---------+---------+
| eric | 52 | 52 | 52 | 52 |
| troy | 11436 | 84.711111111111 | 10 | 99 |
| wade | 38 | 38 | 38 | 38 |
+----------+-------+-----------------+---------+---------+
SELECT username, SUM(statusDuration) as 'Total',
-> avg(statusDuration) as 'average',
-> min(statusDuration) as 'minimum',
-> max(statusDuration) as 'maximum' from workerLogs group by username;
Array ( [0] => eric [1] => eric [2] => 52 [3] => 52 [4] => 52 [5] => 52 [6]
=> 52 [7] => 52 [8] => 52 [9] => 52 ) Array ( [0] => troy [1] => troy [2] =>
35651 [3] => 35651 [4] => 176.4900990099 [5] => 176.4900990099 [6] => 10 [7]
=> 10 [8] => 99 [9] => 99 ) Array ( [0] => wade [1] => wade [2] => 38 [3] =>
38 [4] => 38 [5] => 38 [6] => 38 [7] => 38 [8] => 38 [9] => 38 )