I have a question in a PHP code.
My code is generating several alerts:
Anditseemsthatthesameisnotmakingconnectiontothedatabase,becauseI'mhavingitprintsomedataanditdoesnotprintanythingonthescreen.
I'llputhereasnippetofcode:
<?php$conectar=mysqli_connect("localhost","root","") or die ("Erro na conexão");
mysqli_select_db("painel_admin");
?>
<?php
session_start();
$usuariot = $_POST['usuario'];
$senhat = $_POST['senha'];
include "conexao.php";
$result = mysqli_query("SELECT * FROM usuario WHERE usuario='$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");
}
?>