title: sql find date between two php date values
body: <p>I can't seem to find the answer to my dilemma, I have two php variables</p>
  
  <pre><code>$todaysDate = date('Y-m-d'); //output 2013-07-29
  $twoWeeksAgo = date('Y-m-d', strtotime('-2 weeks')); //output 2013-07-15
  
  $dates = mysqli_query($link, "SELECT attend_date FROM $table WHERE attend_date &lt;= '$todaysDate' AND attend_dateORDER BY date ASC"); //Select all dates between today and two weeks ago
  </code></pre>
  
  <p>when I stick them into my query, I get an error and cannot loop through the result. Any ideas on how to make this work?</p>
  
  <p>Here is the error I have been getting:
  Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result</p>