简体   繁体   English

和Kohana Jelly一起使用

[英]Using 'and' with Kohana Jelly

I am counting how many rows there are in a database that match two conditions 我正在计算数据库中符合两个条件的行数

$rows = Jelly::select('brief')->where('creator_id', '=', $this->view->user->id, 'and', 'name', '=', $name)->count();

I have done this before a long time ago and have forgotten how. 我很久以前就做过,却忘记了如何做。 I was wondering if this is the correct way of doing it. 我想知道这是否是正确的方法。

I just can't seem to find my answer through Google. 我似乎无法通过Google找到答案。

$rows = Jelly::select('brief')->where('creator_id', '=', $this->view->user->id )->where('name', '=', $name)->count();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM