I have a database table storing announcements. The table has a datetime column called "created", and I'd like to only show announcements that were entered within the last 7 days (in my chronoconnectivity connection). It seems that the where clause just filters everything out. Anyone know how I'm supposed to do this?
I tried the following code (in the Model conditions section):
I have the debug section enabled, and the where clause of my query shows up like this:
"WHERE announcements.created between 1400636096 and 1400722496"
I tried the following code (in the Model conditions section):
<?php
$oneWeekAgo = strtotime("-1 week");
$now = strtotime("now");
return array(":announcements.created between $oneWeekAgo and $now");
?>
I have the debug section enabled, and the where clause of my query shows up like this:
"WHERE announcements.created between 1400636096 and 1400722496"