Notice: Undefined property: stdClass::$nome in C:\xampp\htdocs\peliculas\Model\Cliente.class.php on line 79
Notice: Undefined property: stdClass::$id in C:\xampp\htdocs\peliculas\Model\Cliente.class.php on line 80
How do I resolve this error? The line at issue for error 79 and 80 is:
$_SESSION['nomeCliente'] = $row->nome;
$_SESSION['idCliente'] = $row->id;
public function logarCliente(){
$c = new Conexao();
$sql = mysqli_query($c->conectar(), "SELECT email, senha FROM clientes WHERE email = '{$this->getEmail()}' AND senha = '{$this->getSenha()}' AND ativo = 1");
$c->desconectar();
if(mysqli_num_rows($sql) > 0){
$row = $sql->fetch_object();
$_SESSION['nomeCliente'] = $row->nome;
$_SESSION['idCliente'] = $row->id;
$_SESSION['logado'] = true;
return true;
}else{
return false;
}
}