Jay, No results are returned. It is blank. > > From: "Jay Blanchard" <[EMAIL PROTECTED]> > Date: 2003/08/04 Mon PM 04:57:17 EDT > To: "Ben C." <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL > > [snip] > Unsure. How would I do that? > [/snip] > > Ben I think that we have a communications failure. Let's start > over...you wish to total a database column using php, correct? > Everything that you have been shown so far will do that. Is it possible > that there are no query results? If not, then we are doing the query > wrong. Try it with single quotes; > > $sql_2 = "SELECT paidamount FROM $tb_name WHERE id = '" . $id . "' "; > > Please do a verbose check on the query to see if it is working properly > > if(!($result_2 = mysql_query($sql_2, $connection))){ > print("MySQL reports: " . mysql_error() . "\n"); > exit(); > } > > Let's use objects instead of arrays (humor me for a moment) > > while($row = mysql_fetch_object($result_2)){ > $paid = $row->paidamount; > echo "$paid \n"; > $total = $total + paid; > } > > echo "$total \n"; > > Please copy and paste the results into your reply >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php