RE: Re: [PHP] Addin a column of numbers not using MySQL
| From: | Ben C . | Date: | Mon, 04 Aug 2003 19:04:12 +0000 |
| Subject: | RE: Re: [PHP] Addin a column of numbers not using MySQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-158184@lists.php.net to get a copy of this message | ||
I tried the code again and still returns a '0'. It looks like the while() is only looping
one record at a time. It does looks like it is add all the records. Do you or anyone have any
other suggestions?
>
> From: "Jay Blanchard" <jay.blanchard@niicommunications.com>
> Date: 2003/08/04 Mon PM 02:16:22 EDT
> To: "Ben C." <benc@cox.net>, <php-general@lists.php.net>
> Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL
>
> [snip]
> while ($row = mysql_fetch_array($result_2)) {
> $paid = $row['paid'];
> }
> ----CODE End-----------------
>
> What I want to do from here is add up all the 'paid' figures.
> [/snip]
>
> while ($row = mysql_fetch_array($result_2)) {
> $paid = $row['paid'];
> $total = $total + $paid;
> }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>