【发布时间】:2014-08-23 07:22:11
【问题描述】:
我在 codeigniter 中使用 WHERE 函数时遇到问题。 假设我们有两个数组如下:
$t1=arrray('a','b');
$t2=array('c','d');
我想对数组$t1 中的元素做OR,我也想对数组$t2 中的元素做OR。然后我想做两个数组的 AND 结果。
例如
where (table1.id='a' or table1.id='b') and (table2.id='c' or table2.id='d').
如何在 codeigniter 中设置?
【问题讨论】:
-
$this->db->where("(table1.id='a' or table1.id='b') and (table2.id='c' or table2.id='d')");
标签: php sql codeigniter