版本: 1.1.3
sum
获取一列的总计值
sum($table, $column, $where)
table [string]
表名称。
column [string]
将要计算的目标列。
where (optional) [array]
过滤记录的 WHERE 子句。
sum($table, $join, $column, $where)
table [string]
表名称。
join [array]
表连接中的关系。
column [string]
将要计算的目标列。
where (optional) [array]
过滤记录的 WHERE 子句。
返回: [number] 一行的总计值。
$total = $database->sum("account", "money");
echo "We have $" . $total; 