开发者

Query a date range with DMZ DataMapper and CodeIgniter

开发者 https://www.devze.com 2023-02-13 21:53 出处:网络
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 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

精彩评论

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