php求和


array_sum()数组求和

 

$a = array(5,15,25);

array_sum($a);    

echo '$aa';// 45

 

sql sum()求和

$sal="SELECT SUM(money) as num FROM dingdan where email0='45' or email5='645'";

$link=mysql_query($sql);

whle($value=mysql_fetch_array($link))

{ echo $value['num'];}

posted @ 2019-03-02 15:17  冯志国  阅读(795)  评论(0编辑  收藏  举报