title: php PDO query doesn't work with hash_hmac()
body: <p>I just read about hash_hmac() function,
  i tried to use it for storing password in DB :</p>
  
  <pre><code>&lt;?php
  $dsn = 'mysql:host=localhost;dbname=test';
  $username = 'root';
  $pass = 'password';
  
  $conn = new PDO($dsn, $username, $pass);
  $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  $conn-&gt;setAttribute(PDO::ATTR_PERSISTENT, TRUE);
  
  $password = '123MonyeTSahuR456';
  
      $p = addslashes(hash_hmac('sha256', $password, '13#slP3mK;"dA$@m', TRUE));    
  
      $query = "INSERT INTO table_one VALUES(NULL, :password)";
  
  try
  {
      $pdo = $conn-&gt;prepare($query);
      $pdo-&gt;bindValue(':password', $p);
  
      if($pdo-&gt;execute())
      {
          echo $pdo-&gt;rowCount();
      }
      else
      {
          echo 'fail';    
      }
  }
  catch(PDOException $e)
  {
      echo $e-&gt;getMessage();
  }
  </code></pre>
  
  <p><strong>the DB details:</strong></p>
  
  <pre><code>id INT NOT NULL AUTO INCREMENT
  password VARBINARY(32) NOT NULL
  </code></pre>
  
  <p>after that i manually check my DB and found a row with BLOB(i never work/use with VARBINARY or BLOB data type before, so this is my first time)</p>
  
  <p>so there's 1 row exist and i try to select the row :</p>
  
  <pre><code>    $query = "SELECT * FROM table_one WHERE password = :password";
  </code></pre>
  
  <p>the value returned by <code>pdo-&gt;rowCount()</code> is 0 , it doesn't find the password im looking for, anyone can tell me why? how to fix this?</p>
  
  <p><strong>another details :</strong> </p>
  
  <p>PHP version : 5.4</p>
  
  <p>OS : Ubuntu 12.04 64 bit
  thanks </p>