RE: Re: [PHP] Addin a column of numbers not using MySQL

From: Date: Mon, 04 Aug 2003 19:10:15 +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-158180@lists.php.net to get a copy of this message
[snip] ----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----------------- [/snip] FOUND IT! ----CODE Begin----------------- $sql_2 = "SELECT paidamount 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['paidamount']; $total = $total + $paid; } ----CODE End-----------------

« previous php.general (#158180) next »