开发者

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');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜