Good morning! I have a panel in php and it is not connecting to the DB. Any password that I enter, the password or the wrong user.
Here is the snippet of the code that makes the connection:
<?php
session_start();
$usuariot = $_POST['usuario'];
$senhat = $_POST['senha'];
include "conexao.php";
$result = mysqli_query("SELECT * FROM usuario WHERE login='$usuariot' AND senha='$senhat' LIMIT 1");
$resultado = mysqli_fetch_assoc($result);
if(empty($resultado)){
$_SESSION['loginErro'] = "Usuário ou senha inválido";
header ("Location: login.php");
}
?>
And below is the snippet of the code that connects to the database:
<?php
$conectar = mysqli_connect("localhost","root","") or die ("Erro na conexão");
mysqli_select_db($conectar, "painel_admin");
?>
Thank you in advance!