Re: mysql query with SUM
| From: | Gerard Samuel | Date: | Wed, 17 Oct 2001 20:12:41 +0000 |
| Subject: | Re: mysql query with SUM | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71388@lists.php.net to get a copy of this message | ||
It outputs ==>
array(1) { [0]=> NULL }
Oh stupid me. Syntax is everything. Sorry for wasting your brain cycles, but 'cars' should have been 'car'.
It works like how it is supposed to be working now.
Thank you for your time....
Andrey Hristov wrote:
$query = "SELECT SUM(count) as sumtotal FROM counter WHERE type = 'cars'"; $result = mysql_query($query); $row = mysql_fetch_array($result); var_dump($row); //echo $row[sumtotal];