riting a very simple search using like and have an option to omit options, however I find the like statement is making query ignore the where statement
$this->db->like('LOWER(location) OR LOWER(name)', strtolower($term));
$this->db->where('stage', 1);
$this->db->order_by("name", "asc");
$query = $this->db->get($this->user_table);
return $query->result();
Example of what the above produces with $term = "dublin";
SELECT * FROM (`users`) WHERE `stage` = 1 AND LOWER(location) OR LOWER(name) LIKE '%dublin%' ORDER BY `name` asc"
It still returns rows where 'stage' is not equal to 1.
Any ideas? Thank you!