title: Select between dates from table - strtotime?
body: <p>I have been trying for a while, read countless stackoverflow answers and still cant crack it!</p>
  
  <p>I have a table in my db with a field called dob. This field is currently just a TEXT field (but i have since tried changing it to a DATE field and still cant get it to work).</p>
  
  <p>The DOB field's data is in this format (UK dates) - 22/05/2016.</p>
  
  <p>Im trying to find out the number of users who's birthdays are between two dates.</p>
  
  <p>For example, anyone who was born in the last two years:</p>
  
  <pre><code>$twoyearsago=date('d/m/Y', strtotime("-2 years"));
  $today = date("d/m/Y");
  
  $sql = mysql_query("SELECT * FROM users WHERE dob &gt;= '" . $twoyearsago . "' AND date &lt;= '" . $today . "' ORDER by id DESC");
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>  $sql = mysql_query("SELECT * FROM users WHERE dob BETWEEN '" . date('d-m-Y', strtotime($twoyearsago)) . "' AND '" . date('d-m-Y', strtotime($today)) . "'";
  </code></pre>
  
  <p>Hopefully you can see where me logic is and hoping you will see where im going wrong - any help would be appreciated. </p>
  
  <p>Jack</p>