title: pdo not binding param properly
body: <p>I've been stuck on this for about 3 days now and asked multiple people about this and no one seems to have an answer to me why this is not working. I cannot figure out why they aren't binding because the bindings work on the select statement but not the update. I know for a fact that <code>$sessCheck['userid']</code> and <code>$sessCheck['hwid']</code> are being set because I already printed them out to check if they were null or something.</p>
  
  <p>The request inbound from slim</p>
  
  <pre><code>{"userid": "1000","hwid":"TESTING"}
  </code></pre>
  
  <p>The function</p>
  
  <pre><code>function updateHWID(){
          $request = Slim::getInstance()-&gt;request();
          //$bsreq = utf8_encode();
          $sessCheck = json_decode($request-&gt;getBody(), true, 9 );
  
          $db = getConnection();
          $sql = "SELECT userid,hwID FROM accounts WHERE userid = :userid";
          $stuff = $db-&gt;prepare($sql);
          $stuff-&gt;bindParam("userid", $sessCheck['userid']);
          $stuff-&gt;execute();
          $db = null;
  
          $rows = $stuff-&gt;fetch(PDO::FETCH_ASSOC);
  
  
          if ($rows['hwID'] != $sessCheck['hwid']) {
                  $sql2 = "UPDATE accounts SET hwID=':hwid' WHERE userID = ':userid';";
  
                  try {
                          $db2 = getConnection();
                          $stmt = $db2-&gt;prepare($sql2);
                          //these two param's are not binding
                          $stmt-&gt;bindParam("userid", $sessCheck['userid']);
                          $stmt-&gt;bindParam("hwid", $sessCheck['hwid']);         
                          $stmt-&gt;execute();
                          //$rt = $stmt-&gt;fetch(PDO::FETCH_ASSOC);
                          //$stmt-&gt;debugDumpParams();
                  } catch(PDOException $e) {
                          echo '{"error":{"text":'. $e-&gt;getMessage() .'}}';
                  }       
          }
  
  }
  </code></pre>
  
  <p>This is the result incoming on the sql log</p>
  
  <pre><code>      1372 Query     UPDATE accounts SET hwID=':hwid' WHERE userID = ':userid'
  </code></pre>
  
  <p>I've also tried this as well as using the which also didn't work</p>
  
  <pre><code>$stmt-&gt;bindParam(":userid", $sessCheck['userid']);
  $stmt-&gt;bindParam(":hwid", $sessCheck['hwid']);   
  </code></pre>
  
  <p>Then I tried this too and it didn't work</p>
  
  <pre><code>$stmt = $db2-&gt;prepare("UPDATE accounts SET hwID='?' WHERE userID = '?';");
  $stmt-&gt;bindParam(1, $sessCheck['hwid'], PDO::PARAM_STR);        
  $stmt-&gt;bindParam(2, $sessCheck['userid'], PDO::PARAM_INT);
  </code></pre>