|
|
 |
Re: FN-FORUM: PHP - Resource id #5
date posted 10th January 2006 22:54
Just to explain what's going on here, a mysql_query with a SELECT sql
statement will return a resource identifier, which you then need to
pass to one of PHP's mysql handling function such as
mysql_fetch_object, mysql_fetch_row, mysql_fetch_array or
mysql_result, which will all return usable data in different formats.
Have a look at the online docs at www.php.net for these functions and
see which one suits your needs.
Tom
On 10 Jan 2006 23:18:40 -0000, John Kyle [EMAIL REMOVED] wro=
te:
>
>
> $dons =3D mysql_query ("SELECT SUM(donation) as sumDonation FROM thegame"=
);
> while($tmpOb =3D mysql_fetch_object($dons) {
>
> print "TOTAL DONATIONS MADE: " . $tmpOb->sumDonation;
>
> }
>
> unset($tmpOb);
> mysql_close($dbh);
> unset($dbh);
>
> Best Regards
>
> John
>
> ----- Original Message -----
> From: "Kevin Choppin" [EMAIL REMOVED]
> To: [EMAIL REMOVED]
> Sent: Tuesday, January 10, 2006 11:08 PM
> Subject: FN-FORUM: PHP - Resource id #5
>
>
> >
> > Hi folks,
> >
> > What am i doing wrong here? This should return the total of all the
> > donations in the donation column. But it just returns "Resource id #5".=
I
> > know its usually the variable, but it isnt ive already tried changing i=
t.
> > Can anyone help? Its probably right under my nose.
> >
> >
> >
> > Many Thanks
> >
> > Kev
> >
> > _________________________________________________________________
> > Are you using the latest version of MSN Messenger? Download MSN Messeng=
er
> > 7.5 today! http://messenger.msn.co.uk
> >
> >
> > --
> > Freelancers, contractors earn more with Prosperity4
> > Call 0870 870 4414 or visit www.prosperity4.com
> > and benefit from Inland Revenue approved expenses today.
> >
> > To advertise here: http://www.freelancers.net/advertising.html
> >
> >
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|