版本: 1.1.3
has
确定目标数据是否存在
has($table, $where)
table [string]
表名称。
where [array]
过滤记录的 WHERE 子句。
has($table, $join, $where)
table [string]
表名称。
join [array]
表连接中的关系。
where [array]
过滤记录的 WHERE 子句。
返回: [boolean] 目标数据存在则返回 True ,否则返回 False 。
Where 参数是必需的。此方法是验证密码的最好方式。
if ($database->has("account", [
"AND" => [
"OR" => [
"user_name" => "foo",
"email" => "foo"
],
"password" => "12345"
]
]))
{
echo "Password is correct.";
}
else
{
echo "Password error.";
}
