Kohana 3.0 ORM 哪里 - 和
我想使用 KO3 ORM 进行相关查询,这意味着我想在 where 中有两个条件:
现在我有:
public function get_free(){
return $this->where('static_members_only','=',self::FREE);
}
并且我想有:
public function get_free(){
return $this->where('static_members_only','=',self::FREE) AND (some other conditions)
}
可能吗?
谢谢你!
i want to make a corelated query using KO3 ORM, meaning that i want to have two conditions in an where:
now i have:
public function get_free(){
return $this->where('static_members_only','=',self::FREE);
}
and i would like to have:
public function get_free(){
return $this->where('static_members_only','=',self::FREE) AND (some other conditions)
}
is it possible?
thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你能尝试一下:Kohana 的 where_open() 和 where_close() 方法吗?
我认为应该这样做。
can you try : Kohana's where_open() and where_close() methods ?
I think it should be done that way.
and_where()
只是where()
的代理,因此无论您选择使用哪个,都没有区别。所以会产生类似这样的结果:
当然,所有变量都会被转义/准备好,所以你不必担心 sql 注入。
and_where()
is just a proxy towhere()
, so there is no difference whichever you choose to use. Sowill produce something like:
Of course, all vars will be escaped / prepared so you don't have to worry about sql injection.