我正在尝试检查数据库中是否设置了密码。但目前它只是说设置了密码
这是我的代码,应该返回“Pass is not in the database”,但返回“Pass is in the database”
public function checkpass($currentalbumid)
{
$query = $this->db->prepare("SELECT `pass` FROM `album` WHERE `album_id` = ?");
$query->bindValue(1, $currentalbumid);
$query->execute();
if($query->rowCount() > 0){
// password is in the batabase
return "Pass is in the database";
} else {
// password is not in the database
return "Pass is not in the database";
}
}
和这个
$currentalbumid = $_SESSION['album_id'];
$check = $upload->checkpass($currentalbumid);
echo $check;