title: Convert jQuery date to php date or mysql date to be inserted correctly in database
body: <p>I use jQuery datepicker with the following code</p>
  
  <pre><code>$(".item").datepicker({
    showWeek: true,
    firstDay: 1,
    minDate: -30,
    dateFormat: 'mm-dd-yy'
  });
  </code></pre>
  
  <p>The value of that datepicker will be sent via ajax to php function which insert a data in mysql table.</p>
  
  <p>The <code>date</code> column type from mysql database is <code>Datetime</code>.</p>
  
  <p>Every time when read value from datepicker input value, the <code>date</code> column in database is empty shows <code>00-00-0000 00:00:00</code>.</p>
  
  <p>I am newbie in php and maybe I made somewhere a mistake.</p>
  
  <p>the php piece of code</p>
  
  <p><code>mysqli_query($connect, "Insert into tab(date) values ('".$myData."')");</code></p>
  
  <p>how to format javascript date in that right for mysql  ?</p>