I want to implement the following mysql statement in CodeIgniter.
select * from table_name
where deleted = 0 and (id = "18" or name = "efgh" or imei = "1244");
I have written the following statements in 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();
But these two statements are giving different outputs. Could any one please point out the error in the CodeIgniter statement? Thank you.