<[EMAIL PROTECTED]> wrote:
> suppose i have a multidimensional array ex:
>
> row[monthnr][daynr][hour][numberofusers]
> row[monthnr][daynr][hour][numberofmails]
> row[monthnr][daynr][hour][numberofdownloads]
>
> the values in the array are a sql result query, soh not all of
them are
> filled like it is possible that row[12][1][23] is undefined.
>
> i need to tag the value that is maximum and minimum foreach number
of
> users, numberof mails and numberofdownloads in the same month for example,
i
You might want to try to get this info directly from an SQL query. It'll
probably be much faster than a PHP solution involving looping through each
available month and finding the max and min for 3 different keys. If you
decide to do this you'll probably want to nest "while ( list( $key, $val ) =
each( $row[$i][number..] )" type statements, but given that the key "hour"
isn't really needed you may have to transform your array and I really don't
think this solution is as elegant as using a database query.
SELECT month,
MAX(numberofusers) AS numberofusers_max,
MIN(numberofusers) AS numberofusers_min,
...,
MIN(numberofdownloads) AS numberofdownloads_min
FROM my_table
GROUP BY month
WHERE where_clause;
--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]