title: MySQL PDO Error: 'Data too long for column' when passing a boolean parameter for a BIT column
body: <p>The only similar question I have found is: <a href="https://stackoverflow.com/questions/8752915/insert-php-boolean-into-mysql-bit-column-with-zend-db">Insert php boolean into mysql bit column with Zend_Db</a> but this has no answer.</p>
  
  <p>Please see below a simplified test:</p>
  
  <p>The 'allow' column type is BIT.<br>
  The 'roleID' column type is INT.<br>
  The 'permID' column type is INT.</p>
  
  <pre><code>$dbo = new PDO("mysql:dbname=database;host=127.0.0.1", "phpuser", "pass");
  
  $query = $dbo-&gt;prepare("INSERT INTO ws_role_perms (allow, roleID, permID)
                              VALUES (:allow, :roleID, :permID)");
  
  $query-&gt;bindValue("allow", true, PDO::PARAM_BOOL);
  $query-&gt;bindValue("roleID", 1, PDO::PARAM_STR);
  $query-&gt;bindValue("permID", 2, PDO::PARAM_STR);
  
  if ($query-&gt;execute() == false) {
      throw new Exception(print_r($query-&gt;errorInfo(), true));
  }
  </code></pre>
  
  <p>The error message I receive is:</p>
  
  <pre><code>Array (
      [0] =&gt; 22001
      [1] =&gt; 1406
      [2] =&gt; Data too long for column 'allow' at row 1
  )
  </code></pre>
  
  <p>If I attempt to put the equivalent query straight into MySQL, i.e. by running the query: <code>INSERT INTO ws_role_perms (allow, roleID, permID) VALUES (true, 1, 2)</code>
  I have no problems.</p>
  
  <p>Is this a bug in the MySQL PDO driver, or is it just me?</p>
  
  <p>Many thanks in anticipation of your help.</p>