Update user.php

This commit is contained in:
nolanwhy 2023-02-12 11:38:37 +01:00
parent 55e67129d7
commit 2aa58cc97a
1 changed files with 4 additions and 4 deletions

View File

@ -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;