erro:
Undefined index: id in E:\xampp\htdocs\uploadOO\app\pages\usuario\painelUsuario.php on line 21
PainelUsuario.php
$query = new DbFunctions();
$id = $_SESSION['id'];//linha 21
echo $id;
classe DbFunctions
public function login($email, $senha){
$query = $this->select("SELECT id, email, senha, nivel, status FROM usuarios WHERE email = '$email' AND senha = '$senha'
UNION
SELECT id, email, senha, nivel, status FROM administrador WHERE email = '$email' AND senha = '$senha'");
$_SESSION['id'] = $this->getResult()[0];
if(count($this->getResult()) > 1){
$nivel = $this->getResult()['nivel'];
$status = $this->getResult()['status'];
if($nivel == 1 AND $status == 1){
echo "
<div class='aviso-cad green'>
<h2 class='font-media titulo'>Logado com sucesso!!</h2>
</div>
";
sleep(2);
header('Location: ../app/pages/usuario/painelUsuario.php');
}
se alguém puder me ajudar