$this->db->select('users.username, user_records.id, user_records.user_id, user_records.permissions, user_records.table_name'); if($this->codexadmin->state == 'edit' OR $this->codexadmin->state == 'edit_with_array') $this->db->where('record_id',$this->codexadmin->active_id); $this->db->where('table_name',$this->codexadmin->db_table); $this->db->join('users','users.id = user_records.user_id');