I am learning PHP and I have been stuck here, the error is as follows:
Warning: mysqli_fetch_row () expects parameter 1 to be mysqli_result, boolean given in C: \ xampp \ htdocs \ intranet \ scripts \ functions.php on line 29
And here I leave my function:
function validarLogin($usuario, $clave){
global $conexion;
$consulta = "SELECT * FROM usuarios WHERE usuario = '".$usuario."'' AND clave = '".$clave."'";
$respuesta= mysqli_query($conexion, $consulta);
if ($fila = mysqli_fetch_row($respuesta) ) {
session_start();
$_SESSION['usuario'] = $usuario;
return true;
}
return false;
}
Good afternoon, thanks for the feedback, the error is solved, now I have this script that serves as a bridge to access the user panel, I enter the correct username and password, and even tells me that they are incorrect, in addition to show blank page
alert ('The data entered is incorrect') location.href="../ index.php";