title: Select data between two dates
body: <p>I have six dropdown menus for selecting two dates
  I have the folowing code, which give me no results no matter which date i choose</p>
  
  <pre><code>$year1 = $_POST['year1'];
  $month1 = $_POST['month1'];
  $day1 = $_POST['day1'];
  $date1 = $year1 . "/" . $month1 . "/" . $day1;
  $year2 = $_POST['year2'];
  $month2 = $_POST['month2'];
  $day2 = $_POST['day2'];
  $date2 = $year2 . "/" . $month2 . "/" . $day2;
  $result = mysql_query("SELECT * FROM services WHERE date between  '%" . $date1 . "%' AND '%" . $date2 . "%' ORDER BY id " );
  </code></pre>
  
  <p>but if I replace variables $date1 and $date2 in last line with specific date i get the right result.</p>
  
  <pre><code>$result = mysql_query("SELECT * FROM services WHERE date between  '2012/10/01' AND '2012/11/12' ORDER BY id " );
  </code></pre>
  
  <p>Can anyone tell what it wrong with variable $date1 and $date2?</p>