solution reqd for summation of vertical columns in PHP
am 14.09.2008 04:05:49 von Vaibhav Informatics
------=_Part_147660_28592214.1221357949776
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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 :vaibhavinformatics@gmail.com
------=_Part_147660_28592214.1221357949776--
Re: solution reqd for summation of vertical columns in PHP
am 14.09.2008 04:13:42 von 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
Re: solution reqd for summation of vertical columns in PHP
am 14.09.2008 21:50:07 von 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