I have the following table :
id dateStart dateEnd active
1 2012-11-12 2012-12-31 0
2 2012-11-12 2012-12-31 0
I want to check if today's date is in between dateStart
and dateEnd
.
The following is my query for this :
$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;
But so far it's not working as it returns zero rows.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…