Adding up the RESULT
| From: | Joel Colombo | Date: | Wed, 17 Apr 2002 16:08:46 +0000 |
| Subject: | Adding up the RESULT | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18604@lists.php.net to get a copy of this message | ||
i was wondering about a PHP function like mysql_fetch_array
but that would select all the ROW values of one FIELD
rather the "mysql_fetch_array" selecting all FIELDS of ONE row.
does PHP have that function ?
basically y do i need that ?
because i am selecting a number of rows from my table from 1 to 35000 at a
time
i need the SUM of one field based on the ROWS selected....
but... no GROUP BY because the table has 2 fields: index, and fieldname
so i was looking to take my $result
in a function that i can then apply array_sum( ) to.
also the processing time to WHILE ( ) through the results is unacceptable at
30000 results.
i have also posted this question in mailing.database.mysql but the traffic
in that group has been too light...
and posted to alt.php.sql but i will take any suggestions from any group on
this one...
so please let me know if n e one has a solution or knows of a function.
Thanks
Joel Colombo