試試
$this->db->where('uid', 2);
为何要用like,我不模糊查询。。。。
like 我有用第三參數
不過也沒用
你只能用自定義的:
$this->db->query('SELECT * FROM test where (uid=2 or to_uid=2) and status=1')->result(); $this->db->where('(uid=2');
$this->db->or_where('to_uid=2)');
$this->db->where('status', 1);
以前我也遇到过这个问题,后来就是类似这样处理的;
注意字符串里面有() wlyx 发表于 2014-10-28 10:32
$this->db->where('(uid=2');
$this->db->or_where('to_uid=2)');
$this->db->where('status', 1);
這樣也行...真是高招 Closer 发表于 2014-10-28 10:44
這樣也行...真是高招
看完相关处理代码,发现这样也行,哈哈
开始是直接写语句的,后来就改成这样了{:soso_e113:}
wlyx 发表于 2014-10-28 10:32
$this->db->where('(uid=2');
$this->db->or_where('to_uid=2)');
$this->db->where('status', 1);
你的回答解决了我的一个难题,太感谢了
页:
1
[2]