title: datepicker is not posting to mysql
body: <p>I have tried most if not all of the suggestions on this forum, as well as a few others, but I'm still getting <strong>0000-00-00</strong> in MySQL DB even though it echos back correct format.<br>
  Here is the PHP code:</p>
  
  <pre><code>    &lt;?php
      include_once("includes/form_functions.php");
      // START FORM PROCESSING
      if (isset($_POST['submit'])) { // Form has been submitted.
          $errors = array();
          // perform validations on the form data
          $required_fields = array('location', 'date');
          $errors = array_merge($errors, check_required_fields($required_fields, $_POST));
  
          $location = trim(mysql_prep($_POST['location']));
          $date = mysql_prep($_POST['date']);
          $adult = mysql_prep($_POST['adult']);
          $child = mysql_prep($_POST['children']);
          $guest = mysql_prep($_POST['guest']);   
          $hg = mysql_prep($_POST['holyghost']);  
          $baptism = mysql_prep($_POST['baptism']);
  
              if ( empty($errors) ) {
              $query = "INSERT INTO attendance (
              location, date, adult, children, guest, holyghost, baptism
                          ) VALUES (
          '{$location}', {$date}, {$adult}, {$child}, {$guest}, {$hg}, {$baptism} 
                          )"; 
              $result = mysql_query($query, $connection);
              if ($result) {
                  $message = "submission completed.";
              } elseif
                  ($message = "This form cannot be submitted at this time.");
                   $message .= "&lt;br /&gt;" . mysql_error();
              }
          }
     ?&gt;
  </code></pre>
  
  <p>Here is the datepicker code:</p>
  
  <pre><code>     &lt;head&gt;
       &lt;link rel="stylesheet" href="stylesheets/jquery-ui.css" /&gt;
            &lt;script src="javascripts/jquery-ui-1.10.2/jquery-1.9.1.js"&gt;&lt;/script&gt;
            &lt;script src="javascripts/jquery-ui-1.10.2/ui/jquery-ui.js"&gt;&lt;/script&gt;
            &lt;script type="text/javascript"&gt;
            $(function() {
              $( "#datepicker" ).datepicker({
                  dateFormat: "yy-mm-dd"
                  });
            });
            &lt;/script&gt;
      &lt;/head&gt;
  </code></pre>
  
  <p>Any Help would be appreciated.</p>