1
I installed a login and registration system in a hosting, adjusted the database and connected to the system, including created a user to test the login. However when I log in it presents these errors:
Warning: mysqli_query() expects at least 2 parameters, 1 given in /srv/disk5/2615118/www/ge2018.atspace.eu/classes/Login.class.php on line 4
Warning: mysql_num_rows() expects parameter 1 to be resource, null given in /srv/disk5/2615118/www/ge2018.atspace.eu/classes/Login.class.php on line 5
The error code follows below:
<?php
class Login{
public function logar($email, $senha){
$buscar=mysqli_query("SELECT * FROM usuarios WHERE email='$email' AND senha='$senha' LIMIT 1");
if(mysql_num_rows($buscar) == 1){
$dados=mysql_fetch_array($buscar);
if($dados["status"] == 1){
$_SESSION["email"]=$dados["email"];
$_SESSION["senha"]=$dados["senha"];
$_SESSION["nivel"]=$dados["nivel"];
setcookie("logado",1);
$log=1;
}else{
$flash="Aguarde a nossa aprovação!";
}
}
if(isset($log)){
$flash="Você foi logado com sucesso";
}else{
if(empty($flash)){
$flash="Ops! Digite seu e-mail e sua senha corretamente!";
}
}
echo $flash;
}
}
?>
I made the changes and gives the same mistake!
– Antonio