----CODE Begin-----------------
$sql_2 = "SELECT SUM(paidamount) as paid
        FROM $tb_name
        WHERE id = \"$id\"
        ";

$result_2 = @mysql_query($sql_2,$connection) or die(mysql_error());

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.

> 
> From: Jason Wong <[EMAIL PROTECTED]>
> Date: 2003/08/04 Mon PM 01:55:40 EDT
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Addin a column of numbers not using MySQL
> 
> On Tuesday 05 August 2003 01:21, Ben C. wrote:
> > I tried the code you provided below but it returned 0.  Is there another
> > way I can do it?
> 
> Please post your code.
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> "Trust me.  I know what I'm doing."
> -- Sledge Hammer
> */
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to