diff --git a/backgroundupdate.php b/backgroundupdate.php index d8e5be9..b25df71 100644 --- a/backgroundupdate.php +++ b/backgroundupdate.php @@ -1,12 +1,12 @@ prepare("SELECT * FROM users WHERE username = :username"); +$statement = $pdo->prepare("SELECT * FROM users WHERE username = :username"); //building a statement & getting the whole line of username = $username $result = $statement->execute(array('username' => $username)); -$user = $statement->fetch(); +$user = $statement->fetch(); //putting the stuff in an array and afterwards store it in the session: $_SESSION['userid'] = $user['id']; $_SESSION['email'] = $user['email']; $_SESSION['username'] = $user['username'];