>I have created a table which has a column called cost. How do I add up all
>the numerical data in the cost column and display that on a webpage?

<?php
  $query = "select sum(cost) from whatever where blah, blah, blah";
  $cost = mysql_query($query) or error_log(mysql_error());
  $cost = mysql_result($cost, 0, 0);
?>

-- 
Like Music?  http://l-i-e.com/artists.htm


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

Reply via email to