Toda vez que tento logar recebo o seguinte erro:
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in functions_usuario.php on line 6
Function em questão
<?php
function buscaUsuario($conexao, $email, $senha) {
$senhaMd5 = md5($senha);
$query = "select * from usuarios where email='{$email}' and senha='{$senhaMd5}'";
$resultado = mysqli_query($conexao, $query);
$usuario = mysqli_fetch_assoc($resultado);
return $usuario;
}
login
<?php include ("conexao.php");
include("functions_usuario.php");
$usuario = buscaUsuario($conect, $_POST["email"], $_POST["senha"]);
var_dump($usuario);
Formulario
<form action="login.php" method="post">
<table class="table">
<tr>
<td>Email</td>
<td><input class="form-control" type="email" name="email"></td>
</tr>
<tr>
<td>Senha</td>
<td><input class="form-control" type="password" name="senha"></td>
</tr>
<tr>
<td><button type="submit" class="btn btn-primary">Login</button></td>
</tr>
</table>
</form>