Sum
计算列的总值。
sum($table, $column, $where)
-
table [string]
表名。
-
column [string]
将要计算的目标列。
-
where (可选) [array]
用于过滤记录的 WHERE 子句。
sum($table, $join, $column, $where)
-
table [string]
表名。
-
join [array]
表的表关联。
-
column [string]
将要计算的目标列。
-
where (可选) [array]
用于过滤记录的 WHERE 子句。
返回: [string] 列的总值。
$total = $database->sum("account", "money"); echo "我们共有 $" . $total;