title: PDO Not Inserting Into Database
body: <p>Hopefully someone will be able to help me because I've been banging my head against the wall all night trying to solve this little problem.</p>
  
  <p>I want to insert data into a database using PDO (which I am admittedly not the most knowledgeable about). I am using a statement that I have used many times in the past, but for some reason this time it's not working.  The statement is as follows:</p>
  
  <pre><code>$userID = "Johnny5"; 
  $sql = "INSERT INTO user_info(user_id) VALUES(:user-id)";
           if($stmt = $this-&gt;_db-&gt;prepare($sql)) 
           {
              $stmt-&gt;bindParam(":user-id", $userID, PDO::PARAM_STR);
              $stmt-&gt;execute();
              $stmt-&gt;closeCursor();
              return TRUE;
           } else {
              return FALSE;
           }
  </code></pre>
  
  <p>But unfortunately this is always returning <code>TRUE</code> without ever entering anything into my database.  I have tried every combination changes to the statement that I could think of, but I am still at a loss. </p>
  
  <p>I hope someone out there can point out a really simple error that I have made.</p>
  
  <p>Also, placing single quote marks around the parameter <code>:user-id</code> in the <code>$sql</code> string is the only way that I can get anything to appear into the database, but that obviously doesn't enter in any actual data into the database.</p>
  
  <p><strong>EDIT</strong>
  I have also changed the PDO parameter types from <code>PDO::PARAM_STR</code> to <code>PDO::PARAM_INT</code> but have still had no luck.</p>
  
  <p>After further investigation, <code>execute()</code> is returning <code>FALSE</code>.</p>
  
  <p><strong>Solution</strong>
  Thanks to everyone for their guidance.  @Nabeel was correct in saying not to use placeholders in PDO parameters.</p>