title: Insuring that 00/00/0000, 00:00, "", 0 or NULL stays NULL when inserting with pdo prepare
body: <pre><code>  $wpdb-&gt;query(
      $wpdb-&gt;prepare(
        &quot;INSERT INTO `wp_product` (&quot; .
        &quot; `SoldDate`, `NoImage`  &quot; .
        &quot;) VALUES (&quot; .
        &quot; %s, %s&quot; .
        &quot;) &quot; .
        &quot;ON DUPLICATE KEY UPDATE &quot; .
        &quot;`SoldDate` = VALUES(`SoldDate`), &quot;.
        &quot;`NoImage` = VALUES(`NoImage`), &quot;.
        array(
          $car-&gt;SoldDate,
          !$car-&gt;PhotoList
        )
      )
    );
  </code></pre>
  <p>I have this code and it seems NULL values, &quot;&quot; or 0 values turns into 0000-00-00 00:00:00, how do you insure that this date is always NULL when we receive 0, NULL, &quot;&quot;? The code used to work, but now it always return 0000-00-00 00:00:00 for every product and I am not sure why.</p>