title: Mysql - inserting NULL values in datetime field
body: <p>I am updating a entry in my form </p>
  
  <p>while doing so i cleared the value in datetimepicker and proceeding</p>
  
  <pre><code>if (empty($_POST['dtp'])) {
  $Dtp = NULL;
  }
  </code></pre>
  
  <p>Then posting as </p>
  
  <pre><code>'dtp' =&gt; $Dtp
  </code></pre>
  
  <p>SQL echo is like </p>
  
  <pre><code>UPDATE tbl_dummy SET Id="3",dtp="",Remark="update1"
  </code></pre>
  
  <p>The error is </p>
  
  <blockquote>
    <p>1292 - Incorrect datetime value: '' for column 'dtp' at row 1</p>
  </blockquote>
  
  <p>Kindly guide me to solve this and insert NULL value in db</p>