title: PHP PDO array result returning but not working with IF
body: <p>I have a PHP script using PDO where I check a user's submitted email/password against a database. If the query returns a row, it is supposed to take the user to a success page, or if the credentials are incorrect they are supposed to be taken to a failed login page. However, the user is always taken to the fail page.</p>
  
  <pre><code>$sql = "SELECT email, password FROM user WHERE email= $email AND password = $password";
  $stm = $db-&gt;prepare($sql);
  $stm-&gt;execute();
  
  $result = $stm-&gt;fetchColumn();
  
  if ($result !== FALSE) {
  
       header('Location: ./success.html');
  }
  else {
  
      header('Location: ./failed.html');
  
  }
  </code></pre>