Hi guys! Thanks a lot to both of you for your help! I've used both inputs as a solution. I set parameters before binding them and it fixed everything! So strange, but everything works now. :)
if(empty($new_password_err) && empty($confirm_password_err)){
$sql = 'UPDATE users SET password = :password WHERE email = :email';
if($stmt = $pdo->prepare($sql)){
$param_password = password_hash($new_password, PASSWORD_DEFAULT);
$param_email = $email;
$stmt->bindParam(":password", $param_password, PDO::PARAM_STR);
$stmt->bindParam(":email", $param_email, PDO::PARAM_STR);
if($stmt->execute()){
header("location: login.php");
exit();
} else{
echo "Oops! Something went wrong. Please try again later.";
}
unset($stmt);
}
}
unset($pdo);
}