简体   繁体   English

MySQL输出到php echo

[英]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 我做了这个MySQL查询来总结一列,然后我做了echo $ rake,我得到了输出:资源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. 我不是很擅长mysql所以我不确定。 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? 在查询中做什么,“作为RakeSum”是什么意思?

Here $rake is a resource 这里$rake是一种资源
give a look here to know how to use mysql_fetch_assoc to get data from a resource 看看这里知道如何使用mysql_fetch_assoc从资源中获取数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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