从mysql select查询中求和 [英] Summing the Values from mysql select query
本文介绍了从mysql select查询中求和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想总结一下您可以在下面的代码片段中看到的$ row [''val'']返回的值:
Hello all,
I want to sum up the values returned by the $row[''val''] that you can see in my code snippet below:
/*
this part contains the connection parameters
*/
$query = "SELECT val FROM table";
$result = mysql_query($query);
/*
this makes sure the result contains data
*/
WHILE($row = mysql_fetch_assoc($result)){
echo $row['val'];
}
预先谢谢您.
Thank you in advance.
推荐答案
row [''val''],您可以在下面的代码段中看到:
row[''val''] that you can see in my code snippet below:
/*
this part contains the connection parameters
*/
查询 = " ;
query = "SELECT val FROM table";
结果 = mysql_query(
result = mysql_query(
这篇关于从mysql select查询中求和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文