From 2aa58cc97ae8bf9dc62022688f3dc5a743599842 Mon Sep 17 00:00:00 2001 From: nolanwhy Date: Sun, 12 Feb 2023 11:38:37 +0100 Subject: [PATCH] Update user.php --- core/classes/user.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/classes/user.php b/core/classes/user.php index c981dd9..7223af0 100644 --- a/core/classes/user.php +++ b/core/classes/user.php @@ -15,13 +15,13 @@ class User { public function isLoggedIn() { if(isset($_SESSION["user"])) { $q = $this->con->prepare("SELECT * FROM users WHERE id = :id"); - $q->bindParam(':id',$this->sqlData["id"],PDO::PARAM_INT); + $q->bindParam(':id',$_SESSION["user"],PDO::PARAM_INT); $q->execute(); $usr = $q->fetch(); - if($usr) { - return true; - } else { + if(!$usr) { return false; + } else { + return true; } } else { return false;