I have 2 mysql queries on a PHP page:
The first query just checks the exact match of a departure date and returns the exact results. this works as expected:
$result = mysql_query("SELECT destination, departureDate
DATE_FORMAT(departureDate, '%d/%m/%Y') as formattedDate from Entries where DATE_FORMAT(departureDate, '%d/%m/%Y') = '$dep' ");
The second query will only be excecuted if there are no exact entries, that s why i am using the interval so that it can check alternative dates within 7 days for example, rather than say nothing is found. but at the moment, this returns lot of entries beyond the 7 day interval. It should only display the entries within the interval day set. the query is shown below:
$result = mysql_query("SELECT destination, departureDate, DATE_FORMAT(Date_Add(departureDate, interval 7 day), '%d/%m/%Y') as formattedDate from Entries");
any ideas why the interval is not working?
thanks in advance