solution reqd for summation of vertical columns in PHP

------=_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 [at] gmail.com

------=_Part_147660_28592214.1221357949776--
Vaibhav Informatics [ So, 14 September 2008 04:05 ] [ ID #1968657 ]

Re: solution reqd for summation of vertical columns in PHP

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
Jason Pruim [ So, 14 September 2008 04:13 ] [ ID #1968658 ]

Re: solution reqd for summation of vertical columns in PHP

>
> 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
Niel Archer [ So, 14 September 2008 21:50 ] [ ID #1968660 ]
PHP » gmane.comp.php.database » solution reqd for summation of vertical columns in PHP

Vorheriges Thema: PgCon.US: West registration now open
Nächstes Thema: TUDBC a new unified database API for PHP (Phalanger, Quercus), Ruby (IronRuby, JRuby), Java, C#, VB.