$this->db->select('*'); $this->db->from('table1'); $this->db->form('table2'); modified $this->db->where('table1.id = table2.table1_id'); $this->db->where('table2.id',my_value); $query = $this->db->get();