From 2fe1074666f9ba8334cdd80f0985332b44d4144d Mon Sep 17 00:00:00 2001 From: PICCORO Lenz McKAY Date: Tue, 18 Sep 2018 10:47:46 -0400 Subject: [PATCH] relation n_n : specify the table column in the where * as suggested by @Akshay-Hegde but this only solve the where filter par.. * TODO: we need to search into the $related_field_title and extract/change column ambigous --- application/models/Grocery_crud_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Grocery_crud_model.php b/application/models/Grocery_crud_model.php index 24930055..ebcb8646 100755 --- a/application/models/Grocery_crud_model.php +++ b/application/models/Grocery_crud_model.php @@ -332,7 +332,7 @@ function get_relation_n_n_selection_array($primary_key_value, $field_info) { $this->db->order_by("{$field_info->relation_table}.{$field_info->priority_field_relation_table}"); } - $this->db->where($field_info->primary_key_alias_to_this_table, $primary_key_value); + $this->db->where('`'.$field_info->relation_table.'`.'.$field_info->primary_key_alias_to_this_table, $primary_key_value); $this->db->join( $field_info->selection_table, "{$field_info->relation_table}.{$field_info->primary_key_alias_to_selection_table} = {$field_info->selection_table}.{$selection_primary_key}"