我正在开发一个应用程序,使用 idiorm( https://github.com/j4mie/idiorm ) 从数据库中获取数据。
这是我的代码:
$messages = Model::factory('Messages')->where('from_user_id','1')->find_many();
我想包含 where->('to_user_id','1')
如何将其作为 OR 语句放入我的 Idiorm 查询中?
最佳答案
这看起来像手册告诉您为 OR 条件做的事情
$messages = Model::factory('Messages')
->where_any_is(
array(
array('from_user_id' => 1),
array('to_user_id' => 1)
)
)
->find_many();
关于php - 如何在 PHP 的惯用 SQL 查询中使用 OR?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37308346/