title: MySQL - Search Query between DATE_SUB() AND DATE_SUB() Error
body: <p>I am trying to do a search query (using pdo php and mysql) between a date range which is between (date-7days) and (date-1day) using DATE_SUB() on both so for example:</p>
  
  <pre><code>end_date is 2013-03-26
  search between 2013-03-19 and 2013-03-25 ` 
  </code></pre>
  
  <p>The below query however is using the first date_sub(7 day interval) but ignoring the second (date_sub(1 day interval) so its searching between 2013-03-19 and 2013-03-26. </p>
  
  <pre><code>$sevd_query = " 
      SELECT 
          booking_id,
          DATE_FORMAT(start_date, '%e/%c') AS s_d,
          DATE_FORMAT(end_date, '%e/%c') AS e_d
      FROM 
          bsi_bookings as bb 
      INNER JOIN 
          bsi_reservation as br ON bb.booking_id=br.bookings_id
      WHERE 
          bc.c_id=:c_id AND
         :day BETWEEN DATE_SUB(bb.end_date, INTERVAL 7 DAY) AND DATE_SUB(bb.end_date, INTERVAL 1 DAY)
  ";
  </code></pre>
  
  <p>Can anyone please help? I've been trying to fix this for a week now with no luck</p>