title: PHP Datepicker in SQL query
body: <p>so I have this page that shows today's matches by default, it has this datepicker form </p>
  
  <pre><code>&lt;form method="post"&gt;
  &lt;p&gt; Select Date:&lt;input id="datepicker" type="text" size="8" /&gt; &lt;/p&gt;
  &lt;input type="submit" value="Submit" name="usub" /&gt;
  &lt;/form&gt;
  &lt;?php
      if(isset($_POST["usub"])){ $date = $_POST["datepicker"]; }
  else{ $date = date('Y-m-d'); } 
  $data = mysql_query("SELECT * FROM todaysmatches where matchdate='$date'") or die(mysql_error());
  
  echo $_POST["usub"];
  echo "&lt;h4&gt;$today Matches&lt;/h4&gt; &lt;/br&gt;";
  
  //table
  if (mysql_num_rows($data)==0){
       echo " No Matches";
       echo "&lt;/br&gt;";
       echo "&lt;h4&gt; Sorry About That Check For other Days Or you can Check the Library&lt;/h4&gt;";
   }
  else{
  
  echo "&lt;table border='1'&gt;
  &lt;tr&gt;
  &lt;th&gt;Match&lt;/th&gt;
  &lt;th&gt;Tourmanet&lt;/th&gt;
  &lt;th&gt;Date&lt;/th&gt;
  &lt;/tr&gt;";
  
  while($info = mysql_fetch_array( $data ))
    {
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;" . $info['curmatch'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $info['tournamentname'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $info['matchdate'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
    }
  echo "&lt;/table&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p>what I want is if the user choose a date in the form it would go in the query and bring the data associated with that date while keeping today as the default one when they first load the page</p>