I'm new at this site, and at programming too. The thing is that I am trying to do a login page and it doesnt work. I dont get any error message it just doesnt login even if I put the right login.
$db = new mysqli('localhost', 'root', '', 'test');
$sqli = " SELECT * FROM members WHERE username = $user AND password = $pass ";
if(!$result = $db->query($sqli)){
die('There was an error running the query [' . $db->error . ']');
}
$check_user = mysqli_num_rows($result);
if($check_user>0){
echo "Te has conectado";
} else {
echo "Vuelve a intentarlo";
}
Thanks for helping :)