I'm trying to implement passwordverify in the PDO syntax of php. I have my passwords hashed when registered. When I click on login this error pops up
Parse error: syntax error, unexpected ';', expecting ',' or ')' in C:\xampp\htdocs\try\authenticate.php on line 25
This is my 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'];
}
echo $username ." : ".$password;
$q = 'SELECT * FROM isalonusers WHERE username=:username AND password=:password';
$query = $dbh->prepare($q);
$query->execute(array(':username' => $username, ':password' => password_verify($_POST['password'], $password['password']));
if($query->rowCount() == 0){
header('Location: index.php?err=1');
}else{
$row = $query->fetch(PDO::FETCH_ASSOC);
session_regenerate_id();
$_SESSION['sess_user_id'] = $row['id'];
$_SESSION['sess_username'] = $row['username'];
$_SESSION['sess_name'] = $row['name'];
$_SESSION['sess_phone_number'] = $row['phone_number'];
$_SESSION['sess_gender'] = $row['gender'];
$_SESSION['sess_address'] = $row['address'];
$_SESSION['sess_occupation'] = $row['occupation'];
$_SESSION['sess_birth_date'] = $row['birth_date'];
$_SESSION['sess_userrole'] = $row['user_type'];
echo $_SESSION['sess_userrole'];
session_write_close();
if( $_SESSION['sess_userrole'] == "admin"){
header('Location: adminhome.php');
}else{
header('Location: index.php?err=1');
}
}
?>
What is my syntax error for verifying my password?