Query a date range with DMZ DataMapper and CodeIgniter
I cannot find the solution in the docs for this simple problem.
I want to fetched a set of objects from the database in a specific date range. I'm using DMZ Datamapper in the CodeIgniter environment.
$items = new Entity();
$items->where('date_created', 'date1 < x < date2');
$item开发者_Go百科s->get();
Maybe one needs to use the $items->where_in_func(...) method?
Answer is simple:
$items->where('date_created >', '2011-02-26 14:00:13');
$items->where('date_created <', '2011-02-26 16:00:13');
精彩评论