Re: mysql query with SUM
| From: | Andrey Hristov | Date: | Thu, 18 Oct 2001 03:16:42 +0000 |
| Subject: | Re: mysql query with SUM | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71390@lists.php.net to get a copy of this message | ||
No problema...Everyone of us have been in situation like this.
Have fun.
--
Andrey Hristov
Web Developer
Icygen Corporation
BUILDING SOLUTIONS
http://www.icygen.com
On Wednesday 17 October 2001 04:12 pm, you wrote:
> 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];