Version: v2.3.0
count
Count matching rows in a table.
count($table, $where)
table [string]
The name of the table to query.
where [array] (optional)
The WHERE clause used to filter the rows to count.
count($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 count.
where [array] (optional)
The WHERE clause used to filter the rows to count.
Return Value
[int] The number of matching rows.
This method always returns an integer.
$count = $database->count("account", [
"gender" => "female"
]);
echo "We have {$count} female users.";