title: Using PDO with php
body: <p>I'm trying to use PDO for the first time, I have researched for a couple days trying to get a couple things setup with it. I'm not getting any errors, but when using test messages, I do not receive the Test1 message.</p>
  
  <pre><code>if($_SERVER["REQUEST_METHOD"]=="POST"){
          if(isset($_POST["submit"])){
              if(isset($_POST["firstname"]) &amp;&amp; isset($_POST["lastname"]) &amp;&amp; isset($_POST["username"]) &amp;&amp; isset($_POST["email"])
                      &amp;&amp; isset($_POST["password"]) &amp;&amp; isset($_POST["confirm"])){
                  $firstname = $_POST["firstname"];
                  $lastname = $_POST["lastname"];
                  $username = $_POST["username"];
                  $email = $_POST["email"];
                  $password = $_POST["password"];
                  $confirm = $_POST["confirm"];
                  $hash = md5(rand(0,1000));
  
                  $stmt = $db-&gt;prepare('SELECT username FROM users WHERE username = :username');
                  $stmt-&gt;bindParam(':username', $username);
                  $stmt-&gt;execute();
                  if($stmt-&gt;rowCount() &gt; 0){
                      $error_msg = "Username is taken!";
                  }else{
                      $stmt = $db-&gt;prepare('SELECT email FROM users WHERE email = :email');
                      $stmt-&gt;bindParam(':email', $email);
                      $stmt-&gt;execute();
                      if($stmt-&gt;rowCount() &gt; 0){
                          $error_msg = "Email is taken!";
                      }else{
                          if($password==$confirm){
                              echo "Test";
                              $encryptpass = md5($password);
                              //insert user data into database
                              echo "Test3";
                              $stmt = $db-&gt;prepare('INSERT INTO users(firstname, lastname, username, email, password, hash) 
                                      VALUES (?, ?, ?, ?, ?, ?)');
                              $stmt-&gt;bindParam("ssssss", $firstname, $lastname, $username, $email, $password, $hash);
                              $stmt-&gt;execute();
                              echo "Test1";
                              $success_msg = "Thank you for registering with CrystalDev! \nPlease activate your account by
                                              clicking the link in your email!";
  
                              $to = $email;
                              $subject = 'Signup | Verification';
                              $message = 'Thanks for signing up!
                                              Your account has been created!
                                              Please click this link to activate your account:
                                              http://www.crystaldev.net/verify.php?email='.$email.'&amp;hash='.$hash.'
                                                      ';
                              $headers = 'From:noreply@crystaldev.net' . "\r\n"; // Set from headers
                              mail($to, $subject, $message, $headers); // Send our email
                          }else{
                              $error_msg = "Passwords do not match!";
                          }
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p>SOLUTION (EDITED):
  I found my problem.. I was using a column name that didn't exist in the database I was using.</p>