我有这个$ option数组([0] => 1 [1] => 4 [2] => 10)
我的查询是:
$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' ";
不确定这个查询有什么问题,但它没有给我任何结果。
我试图取出日期范围
$query = "SELECT * FROM table WHERE cc_classification IN ('" . implode("','",$options) . "') ";
它工作正常。
有什么想法吗?
答案 0 :(得分:0)
试试这个。问题我不是在数组中,而是在sql语法中。
$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') ";