title: I need a double if statement in php with different variables
body: <p>I've tried this so far: </p>
  
  <pre><code>$query = "SELECT * FROM users WHERE id = :id";
  $stmt = $connectionPDO-&gt;prepare($query);
  $stmt-&gt;bindParam(':id', $id);
  $stmt-&gt;execute();
  $row = $stmt-&gt;fetch(PDO::FETCH_ASSOC);
  $type = $row['rights'];
  
  if(check_login_status() == false)
  {
     header("Location:error.php");
     exit;
  }
  </code></pre>
  
  <p>If the entry in the column "rights" for the specific user is "user" and if there is no one logged in then it must redirect to error.php. So far this doesn't work. It still shows the page if i'm logged in with a user account. Hopefully I'm specific enough.</p>