I got this error while trying to fetch data using prepare on a select statement
if (isset($POST['submit'])){
$email = $POST['user'];
$password = $_POST['password'];
$state = $myPDO->prepare("SELECT * FROM users WHERE email=? AND password=?");
$state->bind_param("si", $_POST['email'], $_POST['password']);
$state->execute();
$result = $state->fetchAll();
if ($result['email'] == $email && $result['password'] == $password){
header("Location: dashboard.php");
}
$state->close();