title: PDO bindParam behaving strangely
body: <p>I am having a problem getting PDO bindParam to work correctly.  Using this code:</p>
  
  <pre><code>$foo = "bar";
  
  $stmt_1 = $db-&gt;prepare("SELECT * FROM table WHERE foo = $foo");
  $stmt_1-&gt;execute();
  $results_1 = $stmt_1-&gt;fetchAll();
  
  $stmt_2 = $db-&gt;prepare("SELECT * FROM table WHERE foo = ?");
  $stmt_2-&gt;bindParam(1, $foo, PDO::PARAM_STR);
  $stmt_2-&gt;execute();
  $results_2 = $stmt_2-&gt;fetchAll();
  
  $stmt_3 = $db-&gt;prepare("SELECT * FROM table WHERE foo = :foo");
  $stmt_3-&gt;bindParam(":foo", $foo, PDO::PARAM_STR);
  $stmt_3-&gt;execute();
  $results_3 = $stmt_3-&gt;fetchAll();
  </code></pre>
  
  <p>$results_1 contains only the row(s) where foo = bar, $results_2 is empty, and $results_3 contains every entry in "table"</p>
  
  <p>bindValue has the exact same problem, too.  Anyone know what's going on here or what I'm doing wrong?</p>