我有下表:
id dateStart dateEnd active 1 2012-11-12 2012-12-31 0 2 2012-11-12 2012-12-31 0
我想比较dateStart和dateEnd之间的今天日期.
以下是我的查询:
$todaysDate="2012-26-11"; $db = Zend_Registry::get("db"); $result = $db->fetchAll("SELECT * FROM `table` WHERE active=0 AND {$todaysDate} between dateStart and dateEnd"); return $result;
但它不工作.
任何解决方案
提前致谢.
尝试这个::这将解决你的问题
原文链接:https://www.f2er.com/php/131942.htmlSELECT * FROM `table` WHERE active=0 AND CURDATE() between dateStart and dateEnd