RE: Column Totals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----Original Message-----
From: Robby Russell [mailto:robby@xxxxxxxxxxxxxxx]
Sent: Monday, November 15, 2004 11:12 AM
To: benipmiller@xxxxxxxxxxx
Cc: php-general@xxxxxxxxxxxxx
Subject: Re:  Column Totals


On Mon, 2004-11-15 at 11:01 -0700, Ben Miller wrote:
> SELECT SUM(Revenue) FROM Sales WHERE Date='$Date'

What happens when you do:

SELECT Revenue FROM Sales WHERE Date='$Date';

Make sure you're getting values back first..and then you can try to sum
them.

-Robby


--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | robby@xxxxxxxxxxxxxxx
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*    --- Now supporting PHP5 ---
****************************************/

I am getting values back in this case, if there are values for the given
date, that is.  If I do:


	while ($row = mysql_fetch_array($result)) {

		extract($row);

		echo "<TR><TD>$Date<BR></TD><TD>$Revenue<BR></TD></TR>";
	}

for example, it returns a long list of individual sales.

Ben

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux