So i have this code and am trying to get the hash value from the database where there is 'd8578edf8458ce06fbc5bb76a58c5ca4' How can i achieve that by referencing to the hash in the database?
public function hashPassword($string){
return password_hash($string, PASSWORD_DEFAULT);
}
public function login($phonenumber, $password){
$users = DB::select("SELECT * FROM $this->tableName WHERE
(user_phonenumber = '$phonenumber' OR user_email='$phonenumber')
AND user_state !='blocked'");
if (count($users)>0){
if(password_verify($password, 'd8578edf8458ce06fbc5bb76a58c5ca4'))
{
@session_start();
$subscriptionModel = new SubscriptionModel();
$isRegistered = $subscriptionModel->isSubscribed($users[0]->user_id);
$userToSession = $users[0];
$userToSession->isRegistered = $isRegistered;
$_SESSION["user"] = $userToSession;
return $users[0];
}
}return false;
}