title: Jquery datepicker mysql date format
body: <p>I know there are some answers in this topic but i'm fresh and can't manage to do it
  I have insered Jquery UI DatePicker into PHP code but when I'm sending data to MySql I get  this Error: <code>Incorrect date value: '' for column 'date' at row 1</code></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
  &lt;script&gt;
      $(document).ready(function() {
      $("#datepicker").datepicker({
          dateFormat: 'yy-mm-dd'
          });
      })
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;/body&gt;
  &lt;form action="query_insert.php" method="post"&gt;
  &lt;input type="text" id="datepicker"&gt;
  &lt;body&gt;
  </code></pre>
  
  <p>query_insert.php:</p>
  
  <pre><code>&lt;?php
  $con = mysqli_connect("127.0.0.1", "root", "user", "pass");
  // Check connection
  if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  $sql="INSERT INTO expenses (date) VALUES ('$_POST[datepicker]'
  ?&gt; 
  </code></pre>
  
  <p>what I have to change to make it work?</p>