I have this php code for authenticating user account, The foreach loop effects and logs the user to adminhome.php and in my else statement, it sends them back to index.php with an error1 that says account has wrong password. But it doesn't. Did I miss something?

authenticate.php

```
<?php
require 'database-config.php';
session_start();

$username = "";
$password = "";

if(isset($_POST['username'])){
    $username = $_POST['username'];
}
if (isset($_POST['password'])) {
    $password = $_POST['password'];

}

$q = "SELECT * FROM admins WHERE username=:username";

$query = $dbh->prepare($q);
$query->execute(array(':username'=>$username));
$results = $query->fetchAll( PDO::FETCH_ASSOC );

    foreach( $results as $row ){ 
    if(password_verify($password, $row['password'])){

        session_regenerate_id();
        $_SESSION['sess_user_id'] = $row['id'];
        $_SESSION['sess_username'] = $row['username'];
        $_SESSION['sess_name'] = $row['name'];
        $_SESSION['sess_userrole'] = $row['user_role'];

        echo $_SESSION['sess_userrole'];
        session_write_close();

            header('Location: adminhome.php');
    }
    else 
    {
        header('Location: index.php?err=1');
    }
    }

 ?> 

```