public function comparePasswords($userid, $password_for_check)
    {
        $query = "SELECT password FROM {$this->config->table_users} WHERE id = ?";
        $query_prepared = $this->dbh->prepare($query);
        $query_prepared->execute([$userid]);

        $data = $query_prepared->fetch(\PDO::FETCH_ASSOC);

        if (!$data) {
            return false;
        }

        return password_verify($password_for_check, $data['password']);
    }
public function comparePasswords($userid, $password_for_check)
    {
        $query = "SELECT password FROM {$this->config->table_users} WHERE id = ?";
        $query_prepared = $this->dbh->prepare($query);
        $query_prepared->execute([$userid]);

        $data = $query_prepared->fetch(\PDO::FETCH_ASSOC);

        if (!$data) {
            return false;
        }

        return password_verify($password_for_check, $data['password']);
    }
public function comparePasswords ( $ userid , $ password_for_check ) { $ query = "SELECT password FROM {$this->config->table_users} WHERE id = ?" ; $ query_prepared = $ this -> dbh -> prepare ( $ query ) ; $ query_prepared -> execute ( [ $ userid ] ) ; $ data = $ query_prepared -> fetch ( \ PDO :: FETCH_ASSOC ) ; if ( ! $ data ) { return false ; } return password_verify ( $ password_for_check , $ data [ 'password' ] ) ; }
Compare user's password with given password
@param int $userid
@param string $password_for_check
@return bool
Compare user s password with given password