Re: Average Number For Math Functions
| From: | David Robley | Date: | Mon, 02 Sep 2002 04:12:49 +0000 |
| Subject: | Re: Average Number For Math Functions | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-114874@lists.php.net to get a copy of this message | ||
In article <20020830075230.74442.qmail@pb1.pair.com>, aerc@aerc.biz
says...
> Ok I think your definently going in the right direction - when I put this
> into my "series" I seem to be getting this message for each result:
> "Resource id #40" or some other number that in some way represents
> something? Any Clue? Here is my SQL:
>
> $rsum =mysql_query("select sum(rating) from ratings")or
> die (mysql_error());
>
> John
You are missing quite a bit there - $rsum is merely a pointer to the data.
Look at http://www.php.net/mysql_fetch_assoc
which has an example of how
to connect to mysql, issue a query and display the results of the query.
Also, you might find http://www.php.net/extract useful in
future.
--
David Robley
Temporary Kiwi!
Quod subigo farinam