Count
计算表中的行数。
count($table, $where)
-
table [string]
表名。
-
where (可选) [array]
用于过滤记录的 WHERE 子句。
count($table, $join, $column, $where)
-
table [string]
表名。
-
join [array]
表的表关联。
-
column [string]
将要计数的目标列。
-
where (可选) [array]
用于过滤记录的 WHERE 子句。
返回: [int] 行数。
返回的数据类型是数字。
$count = $database->count("account", [ "gender" => "female" ]); echo "我们有 " . $count . " 位女性用户。";