title: PHP MYSQL, 1292: Incorrect date value: '' for column 'sale_date' at row 1
body: <p>I have a MySQL database with a clients table and a person(used for testing) table. My HTML, PHP, and scripts work as expected in the person table. When using the same coding in my clients table I get the following error "1292: Incorrect date value: '' for column 'sale_date' at row 1.</p>
  
  <p>My HTML code is as follows:</p>
  
  <pre><code>&lt;label&gt;Sale Date:&amp;nbsp &lt;input id="cSaleDate" class="cSale" type="date" name="cSaleDate"&gt;&lt;/label&gt;
  </code></pre>
  
  <p>My PHP code:</p>
  
  <pre><code>$sale_date = mysqli_real_escape_string($db,$_POST['cSaleDate']);
  
  if (isset($_POST['cSaleDate']))
      {
          include_once('client.php');
          $saleDate = date('0000-00-00', strtotime($sale_date));
          if (!empty($_POST['cSaleDate']))
          {
              $saleDate = date('Y-m-d', strtotime($sale_date));
          }
      }
  
  $fields = 'fips_code, size_code, client_name, client_state, sale_date';
  $values = "'$fips_code', '$size_code', '$client_name', '$client_state', '$saleDate'";
  
  $sql = "INSERT INTO clients ($fields) VALUES ($values)";
  </code></pre>
  
  <p>The column for the sale date is set as:</p>
  
  <pre><code>Name: sale_date
  Datatype: DATE
  Default: NULL
  </code></pre>
  
  <p>As mentioned before, this code does work with dates in the "person" table, but not with the "clients" table. I have the date column setup the same on both tables. Any help or ideas on why this works for one table but not the other would be greatly appreciated.</p>