Has
确定目标数据是否存在于表中。
has($table, $where)
-
table [string]
表名。
-
where [array]
用于过滤记录的 WHERE 子句。
has($table, $join, $where)
-
table [string]
表名。
-
join [array]
表的表关联。
-
where [array]
用于过滤记录的 WHERE 子句。
返回: [boolean] 表示是否找到数据的布尔值。
$isAccount = $database->has("account", [ "AND" => [ "OR" => [ "user_name" => "foo", "email" => "foo" ], "password" => "12345" ] ]); if ($isAccount) { echo "密码正确。"; } else { echo "密码无效。"; }