【问题标题】:Kohana 3 ORM query using NOTIN()Kohana 3 ORM 查询使用 NOTIN()
【发布时间】:2012-02-24 10:17:04
【问题描述】:

有没有办法将http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_not-in 与 Kohana 的 ORM 一起使用?比如:

$products = ORM::factory('products')->notin('contry_id', $csl)->find_all();

【问题讨论】:

    标签: php kohana kohana-3 kohana-orm


    【解决方案1】:

    使用 where 语句:

    $products = ORM::factory('products')->where('contry_id', 'NOT IN', $csl)->find_all();
    

    $csl 必须是数组

    【讨论】:

    • 谢谢,我刚试过,但忘记将 $csl 参数更改为数组,所以你的回答来得及时!
    猜你喜欢
    • 2011-05-09
    • 1970-01-01
    • 2012-07-27
    • 2013-09-28
    • 1970-01-01
    • 2011-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多