$this->db->select('*'); $this->db->from('SupportThread'); $this->db->join('SupportStatus', 'SupportStatus.id = SupportThread.current_status_id'); $this->db->join('SupportCategory', 'SupportCategory.id = SupportThread.current_category_id'); $this->db->join('SupportPriority', 'SupportPriority.id = SupportThread.current_priority_id'); $this->db->where('userid', $userid); $this->db->where('current_status_id >', 1);