I have this $option Array ( [0] => 1 [1] => 4 [2] => 10 )
My query is:
$query = "SELECT * FROM table WHERE cc_classification IN ('" . implode("','",$options) . "') AND submit_date BETWEEN '2015-07-01 00:00:00' AND '2015-07-10 23:59:59' ";
Not sure what is wrong with this query but it gave me nothing in result.
I tried to take out the date range
$query = "SELECT * FROM table WHERE cc_classification IN ('" . implode("','",$options) . "') ";
and it's working fine.
Any ideas?
Try this. Problem i not in array, but in sql syntax.
$query = "SELECT * FROM table WHERE cc_classification IN ('" . implode("','",$options) . "') AND (submit_date BETWEEN '2015-07-01 00:00:00' AND '2015-07-10 23:59:59') ";