title: Jqueryui datepicker value is not inserted on mysql table
body: <p>So Im using jqueryui datepicker..already set the dateformat to mysql format but sadly it still won't insert into my EventDate field..EventDate has a Date datatype..</p>
  
  <pre><code>&lt;script&gt;
  $(function() {
     $( "#datepicker" ).datepicker({
    dateformat: "yyyy-mm-dd",
    changeMonth: true,
    changeYear: true
  });}); &lt;/script&gt;
  </code></pre>
  
  <p>Maybe there's something wrong with my submit?</p>
  
  <pre><code>&lt;form role="form" action='' method='POST'&gt;
    &lt;div class="form-group"&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
     &lt;p&gt;Event Title:&lt;input type='text' name='EventTitle' class="form-control col-md-offset-4" value='&lt;?php if(isset($error)){ echo $_POST['eventTitle'];}?&gt;'&gt;&lt;/p&gt;
     &lt;p&gt;Date: &lt;input name="datepicker" class="form-control col-md-offset-4" type="text" id="datepicker"&gt;&lt;/p&gt;
     &lt;input type="submit" name="submitevent" class="btn btn-primary  col-md-offset-4 "value="Submit Event"&gt;&lt;br&gt;&lt;br/&gt;
     &lt;a href="/sics/users/MainPanel.php"&gt;&lt;input type='button' class="btn btn-primary  col-md-offset-4 " value='Back'&gt;&lt;/a&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Maybe submitevent.php?</p>
  
  <pre><code>&lt;?php
  
  //if form has been submitted process it
  if(isset($_POST['submitevent'])){
  
      //collect form data
      extract($_POST);
  
      //very basic validation
      if($EventTitle ==''){
          $error[] = 'Please enter the title.';
      }
  
      if($datepicker ==''){
          $error[] = 'Please enter the description.';
      }
  
  
  
      if(!isset($error)){
  
          try {
  
  
  
              //insert into database
              $stmt = $db-&gt;prepare('INSERT INTO events (EventName,EventDate) VALUES (:EventTitle, :EventDate)') ;
              $stmt-&gt;execute(array(
                  ':EventTitle' =&gt; $EventTitle,
                  ':EventDate' =&gt; $datepicker
  
              ));
  
              //redirect to MainPanel page
              header('Location: ../users/MainPanel.php');
              exit;
  
          } catch(PDOException $e) {
              echo $e-&gt;getMessage();
          }
  
      }
  
  }?&gt;
  </code></pre>