0
I can’t identify what my mistake is
is marked the line in the code,
O ERRRO ESTAR AQUI ->[![inserir a descrição da imagem aqui][1]][1] if (mysqli_num_rows($resultado)>0) {
$password = md5($password);
$sql = "SELECT * FROM user WHERE username = '$login' OR email = '$login'";
$resultado = mysqli_query($conexao,$sql);
//$_SESSION['id_usuario'] = $dados['id'];
if(mysqli_num_rows($resultado) == 1){
mysqli_close($conexao);
$dados = mysqli_fetch_array($resultado);
$_SESSION['logado'] = true;
$_SESSION['id_usuario'] = $dados['id'];
echo "<div class='alert alert-success' role='alert'>Login e senha confirmado</div>";
header('location:../../../index.php');
}else{
$erros[] = "<div class='alert alert-danger' role='alert'>Usuario Inexistente</div>";
}
}

This happens because the return of the function
mysqli_queryisfalseornull. Use aif (!$resultado) { die('Not found'); }before functionmysqli_num_rows– Valdeir Psr
Try to change the
if(mysqli_num_rows($resultado) == 1){forif($resultado->num_rows == 1){and see if it corrects.– Luiz Fernando
@Valdeirpsr the error persists,
– Vitor
@Luiz Fernando, the error persists too
– Vitor
@Valdeirpsr posts its code updated at http://pastebin.com
– Valdeir Psr
ok, here this one updated https://pastebin.com/Z1QB22zw
– Vitor
https://pastebin.com/JzXcpmEk
– Valdeir Psr
unfortunately it didn’t work
– Vitor