good morning, I'm trying to do some validations with fetch all
this is my code
$usuariodb = strtolower($_POST['usuario']);
$passworddb = strtolower($_POST['password']);
$conn = new PDO('mysql:host=localhost;dbname=db;charset=UTF8','guest','guest');
//$sql = "SELECT name FROM loginUsr WHERE name ='".strtolower($usuariodb)."'";
$sql = "SELECT * FROM loginUsr BETWEEN name = $usuariodb AND password = $passworddb";
$result = $conn->query($sql);
//nombre del usuario en db para validar
$rows = $result->fetchAll();
if ($usuariodb == $rows['name']) {
header('Location: prueba.php');
}
The last part of the if I would like to directly access each of the data in the rows directly but I am getting as output Fatal error: Call to a member function fetchAll ()