[snip] I tried doing as you said and it returned 0. Is there another way to add up the column? [/snip]
$sql = "SELECT foo FROM table WHERE you have conditions "; if(!($result = mysql_query($sql, $connection))){ print("MySQL reports: " . mysql_error() . "\n"); exit(); } while($row = mysql_fetch_object($result)){ $total = $total + $row->foo; //each time through add the new amount to the last amount } echo"$total\n"; HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php