title: PDO Prepared Select statement for checking if a user exists
body: <p>I'm a pdo newbie and need to prepare and execute some php/pdo code:
  This code works to allow me to create users in my database:</p>
  
  <pre><code>    // Perform Insert / Update
  $STH = $dbh-&gt;prepare("INSERT INTO users (username, email) values (:username, :email)");
  $STH-&gt;bindParam(':username', $username);
  $STH-&gt;bindParam(':email', $email);
      try{
      $STH-&gt;execute();
      redirect_to(signupsuccess.php);
      }
  catch(PDOException $e) {  
  echo "I'm sorry, Dave. I'm afraid I can't do that.";  
  file_put_contents('PDOErrors.txt', $e-&gt;getMessage(), FILE_APPEND); 
  }
      }
  </code></pre>
  
  <p>but before I put that data into the database I need to do a check to make sure the email  doesn't already exist in the database. I need to do a SELECT, something like:</p>
  
  <pre><code>    $STH = $dbh-&gt;prepare("SELECT FROM users (email) values (:email)");
  $STH-&gt;bindParam(':email', $email);
  try{
      $STH-&gt;execute();
        }
  </code></pre>
  
  <p>and I know I need to add</p>
  
  <pre><code>    "WHERE something matches '$_POST'email') something.." ...
  </code></pre>
  
  <p>I'm totally lost at this point..I can do this without PDO but I want to start using PDO's prepared statements..Please help!</p>