Version: v2.4.0
sum
Calculate the sum of values in a column.
sum($table, $column, $where)
table [string]
The name of the table to query.
column [string]
The column to evaluate.
where [array] (optional)
The WHERE clause used to filter the result set.
sum($table, $join, $column, $where)
table [string]
The name of the table to query.
join [array]
The join definitions used to combine related tables.
column [string]
The column to evaluate.
where [array] (optional)
The WHERE clause used to filter the result set.
Return Value
[mixed] The sum of the values in the specified column.
$total = $database->sum("account", "money");
echo "Total amount: {$total}";