I cannot get my database query to work with wildcards.
$this->db->like('film.title',"%$query%");
$this->db->escape_like_str($query);
$res = $this->db->get('film');
If I remove wildcard(%) then search works fine. Also $query is just a string with user input.
$this->db->like()
automatically adds the %s and escapes the string. So all you need is
$this->db->like('title', $query);
$res = $this->db->get('film');