-2
Below is the code I am using to try to make a login system, but it is failing
Code:
<?php
$link = mysqli_query($con, "SELECT * FROM usuarios WHERE nome= $nome AND senha = $senha") or die(mysqli_error($con));
if(mysqli_num_rows($link) <= 0)
{
header("Location:../inicio.php");
}else
{
echo
"
<script type='text/javascript'>
alert('nome de usuário e/ou senha incorretos');
window.location.href='../index.php';
</script>
";
}
?>
Similar message: Unknown column 'teste_bot' in 'Where clause'
Note 1 - I have directly entered a user with name and password in the database called 'teste_bot'
Note 2 - if I put '$name' and '$password' gets the following error -Recoverable fatal error: Object of class mysqli_result could not be converted to string in /Storage/ssd1/516/14288516/public_html/SQL/logar.php on line 10
The fields
$nome
and $passwordnão deveria estar entre apóstrofos?
'$name'e
'$password'`.– anonimo
If I put this error
– user196053