I have a PHP form which submits data in the following format:
Array (
[zone] => Array (
[0] => East
)
[publication] => Array (
[0] => ABP
)
[datefilter] => 09/01/2016 - 10/15/2016
)
I use the data to construct a MySQL query as follows:
$zone_search = $_POST['zone'];
$zone = join("','",$zone_search);
$publication_search = $_POST['publication'];
$publication = join("','",$publication_search);
$tmp = "SELECT * FROM advertisement
WHERE zone IN('$zone')
AND publication IN('$publication')";
However, I want to limit the data to the two dates given in the $_POST['datefilter']
field. How do I add the date filter dates into my query?
The relevant columns in the database table are:
zone
publication
release_date