【发布时间】:2013-07-25 07:28:32
【问题描述】:
我想在 CodeIgniter 中实现下面的 mysql 语句。
select * from table_name
where deleted = 0 and (id = "18" or name = "efgh" or imei = "1244");
我在 CodeIgniter 中写了以下语句:
$this->db->where('deleted', 0);
$this->db->or_where('id', $this->table_name->id);
$this->db->or_where('imei', $this->table_name->imei);
$this->db->or_where('name', $this->table_name->name);
$result= $this->db->get('table_name')->result();
但这两个语句给出了不同的输出。谁能指出 CodeIgniter 语句中的错误?谢谢。
【问题讨论】:
标签: php mysql codeigniter