Hey.. I've run into a problem using several "like" in my sql-query (generated with Codeigniter's activerecord):
SELECT * FROM (`posts`) WHERE `city` LIKE '%test%' AND `title` LIKE '%%' OR `text` LIKE '%%'
Thing is, it appears to read this query as if there was a parenthesis around the first like and the second like, but I want there to be a parenthesis around the second and the last like (I want it to compare if the last or the next to last works).
How can I achieve this using Codeigniter's Active Record class?
Current code: if($type != 0) $this->db->where('type', $type);
$this->db->like('city', $area);
$this->db->like('title', $words);
$this->db->or_like('text', $words);
return $this->db->get('posts')->result_array();