title: MySQL query runs without error but does not populate database
body: <p>Evening folks,</p>
  
  <p>Having another of those "looked at this too long moments".</p>
  
  <p>This code when run return the success message but nothing gets entered into the database table, no errors being thrown up, I know all the correct values are being received from _post but I can't see what's wrong, I have an almost identical query on another page and it works fine.</p>
  
  <p>Can anyone see issues with the code?</p>
  
  <pre><code>if (isset($_POST['username']) &amp;&amp; $_POST['username'] !== '')
  {
  
      $salted = md5($_POST['pass1'] . 'salt');
  
    try
    {
      $sql = 'INSERT INTO users SET 
        username = :username,
        firstname = :firstname,
        lastname = :lastname,
        email = :email,
        password = $salted,
        joined = CURDATE()';
      $s = $PDO-&gt;prepare($sql);
      $s -&gt; bindValue(':username', $_POST['username']);
      $s -&gt; bindValue(':firstname', $_POST['firstname']);
      $s -&gt; bindValue(':lastname', $_POST['lastname']);
      $s -&gt; bindValue(':email', $_POST['email']);
      $s -&gt; execute();
  
    }
    catch (PDOException $e)
    {
      $error = 'Error adding submitted user.';
      echo $error;
      exit();
    }
  
    ?&gt; &lt;div class="alert alert-success"&gt;User added to the database.&lt;/div&gt; &lt;?php
  
  }
  </code></pre>