Re: [PHP-DB] solution reqd for summation of vertical columns in PHP

2008-09-14 Thread Niel Archer
 
 On Sep 13, 2008, at 10:05 PM, Vaibhav Informatics wrote:
 
  Please let me know if there is a simple method to total up the  
  column values
  in Mysql database tables using php as in excel.
 
 I believe what you are looking for is count(fieldname)

COUNT returns the number of rows.  I think they're after SUM

SELECT SUM(price) WHERE available = 1;

would total the values in the returned row's price column

--
Niel Archer



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



[PHP-DB] solution reqd for summation of vertical columns in PHP

2008-09-13 Thread Vaibhav Informatics
Please let me know if there is a simple method to total up the column values
in Mysql database tables using php as in excel.

-- 
Vaibhav Informatics, 304 Vasant Plaza, Munirka, Near Subway, New Delhi-110
067 Ph: 011-26194466 Email :[EMAIL PROTECTED]


Re: [PHP-DB] solution reqd for summation of vertical columns in PHP

2008-09-13 Thread Jason Pruim


On Sep 13, 2008, at 10:05 PM, Vaibhav Informatics wrote:

Please let me know if there is a simple method to total up the  
column values

in Mysql database tables using php as in excel.


I believe what you are looking for is count(fieldname)



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