I am trying to check if there is a password set in the database. But at the moment its just saying that there is a password set
here is my code, is should return with "Pass is not in the database" but its returning with "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";
}
}
and this
$currentalbumid = $_SESSION['album_id'];
$check = $upload->checkpass($currentalbumid);
echo $check;