title: PDO Collect username or email
body: <p>I would like to know how can I take verify if username or email (Not both because that I managed to do) are already in my db using this code? </p>
  
  <pre><code>&lt;?php 
  
  /**
  * Register User
  */
  if (isset($_POST['register'])) {
  
  $username = $_POST["username"];
  $email = $_POST["email"];
  $password = $_POST["password"];
  $salt = "Not important";
  $password_hash = crypt($password, "$2y$". $salt);
  
  if (strlen($username) &gt; 20) {
      echo "Username is too big";
  }elseif (strlen($password) &gt; 32) {
      echo "Password is too big";
  }elseif (strlen($email) &gt; 100) {
      echo "E-Mail is too big";
  }else{
      $sth = $dbh-&gt;prepare('SELECT username, email FROM user WHERE username = ? AND email = ?');
      $sth-&gt;execute(array($username, $email));
      if ($result = $sth-&gt;fetch(PDO::FETCH_OBJ)) {
          print $result-&gt;username . "Username and email correct";
      }else{
          echo "Username or email incorrect"; //This is where I want to know how can I check one after another?
      }
  
  }
  }else{
  echo "Not important";
  }
  
  
  ?&gt;
  </code></pre>
  
  <p>Thank you</p>