title: PDO - Dynamic bindParam - value of 0 strange result
body: <p>So thanks to suggestions from users here I have started porting my code over to PDO.  Everything was going well until one little issue.</p>
  
  <p>I have a small function to handle my database calls, which basically generates the SQL query, does the $dbh->prepare ($sql), then loops through and binds the values, then executes the query.</p>
  
  <pre><code>$sth = $dbh-&gt;prepare ($sql);
  // bind parameters
  if ($action == 'insert' || $action == 'update') {
      reset ($array);
      foreach ($array as $key =&gt; &amp;$value) {
          if ($value != 'NOW()') {
              $sth-&gt;bindParam (':' . $key, $value);
          }
      }
  }
  $sth-&gt;execute();
  </code></pre>
  
  <p>This works fine until I need to insert a value of '0'.  No errors are returned, but the value that is inserted into the db turns out to be the maximum value for the column type in the table, in this case is "137".</p>
  
  <p>I'd prefer if someone could explain what is happening as well as providing a solution rather than just give me a fix so I can better understand this.</p>
  
  <p>Cheers,
  Luke</p>