title: PHP PDOException -- Invalid parameter number: Columns/Parameters are 1-based
body: <p>My code is: </p>
  
  <pre><code>.....
  .....
  
  $sql = 'SELECT '.$return_fields.' FROM '.$table.' WHERE '.$search_field.'=:'.$search_field;
  $stmt = $conn-&gt;prepare($sql);
  $stmt-&gt;bindParam($search_field, $search_val);
  $stmt-&gt;execute();
  
  ....
  ....
  </code></pre>
  
  <p>where <code>$search_field = 'reg_user_linked', $search_val = 'aa@gmail.com'</code>.</p>
  
  <p>This error occurs when execute the statement and I couldn't figure out why:</p>
  
  <blockquote>
    <p>Invalid parameter number: Columns/Parameters are 1-based</p>
  </blockquote>
  
  <p>Can anyone help?</p>
  
  <hr>
  
  <p>After hours of trying, I found out that this error only occurs when I was in debugging mode. If I ran the code and print the result, it works.....
  Does anyone know why this happens? (My IDE is NetBeans 7.2, debug tool is xdebug)...</p>