title: PDO PDOStatement::execute(): SQLSTATE[HY000]: General error: 1008 OCIStmtExecute: ORA-01008: not all variables bound
body: <p>I recently converted my website from OCI to PDO.</p>
  
  <p>I have this PHP:</p>
  
  <pre><code>  foreach ($bindings as $key =&gt; $value) {
     if ( strpos( $query, $key) ) {
      $stmt-&gt;bindParam(":$key", $value);
      echo "Bound ". $key ." =&gt; ". $value;
     }
    }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Bound :globalSearch0 =&gt; %NCR%
  Bound :globalSearch1 =&gt; %NCR%
  Bound :globalSearch2 =&gt; %NCR%
  Bound :globalSearch3 =&gt; %NCR%
  Bound :globalSearch4 =&gt; %NCR%
  </code></pre>
  
  <p>but PHP still outputs error message:</p>
  
  <blockquote>
    <p><b>Warning</b>:  PDOStatement::execute(): SQLSTATE[HY000]: General
    error: 1008 OCIStmtExecute: ORA-01008: not all variables bound</p>
  </blockquote>
  
  <p>but all variables <strong>are</strong> bound! I echo the SQL query generated and it is using 5 variables, the same amount that were bound!</p>
  
  <p>Am I totally missing something here? This is the same code that I used <code>oci_bind_by_name</code> with and I never had any problems, but <code>bindParam</code> seems to be causing this.</p>