Kohana 3.2 ORM-唯一值示例
我的问题是:Kohana 3.2 ORM-唯一值示例,orm,kohana-3.2,Orm,Kohana 3.2,我的问题是: $comment = ORM::factory('comment') ->where('status', '=', 1) ->find_all(); 字段=user\u id 如何在user\u id中仅选择一条注释 以下是: $comment = ORM::factory('comment') ->distinct('user_id')
$comment = ORM::factory('comment')
->where('status', '=', 1)
->find_all();
字段=user\u id
如何在user\u id
中仅选择一条注释
以下是:
$comment = ORM::factory('comment')
->distinct('user_id')
->where('status', '=', 1)
->find_all();
显示数据库中的所有内容 您的代码应该更像这样
$comment = ORM::factory('comment')
->where('status', '=', 1)
->group_by('user_id')
->find_all();
查看以了解更多信息。您想做什么?1.显示每个用户id的最新注释。2。为单个用户id选择特定注释。3。想知道如何将参数传递到模型中以选择特定记录。