title: PDO statement fails with error "SQLSTATE[22007]: Invalid datetime format"
body: <p>I have this piece of code for execute a prepared PDO statement:</p>
  
  <pre><code>$sql = 'INSERT INTO territories(territory_id,`name`,`inactive`,`createdAt`,`updatedAt`) VALUES(?,?,?,NOW(),NOW())';
  $stmt = $pdoPdone-&gt;prepare($sql);
  $params = [$territoryId, $territoryName, $inactive];
  
  var_export($params);
  
  $stmt-&gt;execute($params);
  </code></pre>
  
  <p>The output of <code>var_export($params)</code> is as show below:</p>
  
  <pre><code>array (
    0 =&gt; '04T80000000TQw1EAG',
    1 =&gt; 'SA_106SN03',
    2 =&gt; false,
  )
  </code></pre>
  
  <p>But when I try to execute the code I got this error:</p>
  
  <pre><code>PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column 'inactive' at row 1' in /var/sync/sync_bi/sync.php:260
  Stack trace:
  #0 /var/sync/sync_bi/sync.php(260): PDOStatement-&gt;execute(Array)
  #1 {main}
    thrown in /var/sync/sync_bi/sync.php on line 260
  </code></pre>
  
  <p>Where line 260 is <code>$stmt-&gt;execute($params)</code>, so what is wrong? Why PHP or PDO gets confused with value of inactive column?</p>