Try appending to the existing sql_where value instead of overwriting it. Also you should be using $db->sql_in_set() : $event['sql_where'] .= ' AND ' . $this->db->sql_in_set('t.forum_id', $forums_id_ary); Not working. SQL: SELECT t.*, f.forum_id, f.forum_name, tp.topic_posted, tt.mark_time, ft.mark_...