title: PDO: Using same bind variable multiple times
body: <p>I'm having an issue with PDO Prepared statements, where if you need to use the same bind variable multiple times, the query won't validate.</p>
  
  <p>Example:</p>
  
  <pre><code>$params = array (
      ':status' =&gt; $status,
      ':userid' =&gt; $_SESSION['userid']
  );
  
  $stmt = $pdo-&gt;prepare ('
      INSERT INTO 
          tableName
          ( userId, status )
          VALUES
          ( :userid, ":status" )
          ON DUPLICATE KEY UPDATE
              status = ":status"
  ');
  
  if ( ! $stmt-&gt;execute ( $params ))
  {
      print_r( $stmt-&gt;errorInfo ());
  }
  </code></pre>
  
  <p><strong>EDIT</strong>: The values of the <code>$params</code> are:<br />
  <code>Array ( [:status] =&gt; PAID [:userid] =&gt; 111 )</code></p>
  
  <p><strong>EDIT 2</strong>:<br />
  I've noticed that instead of the original values, instead of userid, <em>0</em> is inserted, and instead of status an empty string is inserted.</p>