简体   繁体   中英

MySQL output to php echo

I made this MySQL query to sum a column then i did echo $rake and i got the output : Resource id #13

It will be highly appreciated if anyone can assist me with this

<?php 
        $rake = mysql_query("select sum(value) as RakeSum from rakeitems");

        echo $rake;

?>

Did i forget something after the query? I am not very good at mysql so im unsure. Any help will be nice :) I have tried changing the query up.

And what does as do in the query, "as RakeSum" what does that mean?

Here $rake is a resource
give a look here to know how to use mysql_fetch_assoc to get data from a resource

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM