I have a small login form, with the variables $ user and $ password that have the correct values, the problem is that it gives me
Fatal error: Call to a member function rowCount () on boolean
that is, as if the array were empty and I have no idea why. Here I leave the code (obviously everything is enclosed in the php tags):
include("conectarBD.php");
$usuario = $_POST['user'];
$contrasena = $_POST['pass'];
if (isset($usuario) && !empty($usuario) && isset($contrasena) && !empty($contrasena)) {
$sql = "SELECT usuario, contrasena FROM usuarios WHERE usuario == :usuario";
$statement = $conn->prepare($sql);
$statement->execute(array(':usuario'=>$usuario));
$getUser = $statement->fetch(PDO::FETCH_ASSOC);
$total = $getUser->rowCount();
if ($total = 0) {
echo "Nothing";
}
}