84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
问题是:现在需要统计表table中的num字段全部数据和,并且输出该总值。 统计可以用select sum(num) from table这条sql语句执行,但是问题在于不知道怎么把最终结果读出来???有大神指教吗??
Try setting an alias for the result and you will be able to check it out
$sql = 'select sum(num) AS the_result from table'; $r = $db->query($sql); $r['the_result']; // 想要的结果
$updataquery = "select sum(lv) AS the_result from gti_enews_technology_group" ; $r=$empire->fetch1($updataquery); print_r($r); //打印的结果是Array ( [0] => 252 [the_result] => 252 )
The one upstairs should be fine
Try setting an alias for the result and you will be able to check it out
The one upstairs should be fine