title: Unable to insert NULL in date field for MySQL
body: <p>I am trying to insert NULL to mysql from PHP using mysqli_query.</p>
  
  <p>My code is as follows where I want to insert Null in <code>$chq_date</code>:</p>
  
  <pre><code> $query_string = "INSERT INTO inward_credit
       (custi_id_fk, driver_id_fk, today_date, amount, mode, cheque_date, cheque_no)
       VALUES
       ('$cust_id1', '$driver_id1', '$today_date', '$credit_collected', '$mode', '$chq_date', '$cheque_number')";
  
       $insert_credit = mysqli_query($con, $query_string);
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>$chq_date = "";
  </code></pre>
  
  <p>which resulted in Incorrect date value: '' for column 'cheque_date' at row 1</p>
  
  <pre><code>$chq_date = '';
  </code></pre>
  
  <p>which resulted in Incorrect date value: '' for column 'cheque_date' at row 1</p>
  
  <pre><code>$chq_date = 'NULL';
  </code></pre>
  
  <p>Incorrect date value: 'NULL' for column 'cheque_date' at row 1</p>
  
  <pre><code>$chq_date = "NULL";
  </code></pre>
  
  <p>Incorrect date value: 'NULL' for column 'cheque_date' at row 1</p>
  
  <p>The DB is as </p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `inward_credit` (
  `id` int(11) NOT NULL,
    `custi_id_fk` int(11) NOT NULL,
    `driver_id_fk` int(11) NOT NULL,
    `today_date` date NOT NULL,
    `amount` float(50,2) NOT NULL,
    `mode` int(1) NOT NULL,
    `cheque_date` date DEFAULT NULL,
    `cheque_no` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
    `last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  ) 
  </code></pre>