I added 3 table.
company,category,scategory
category:category_id,name
scategory:scat_id,sname,category_id
company:company_id,scat_id,cname,cweb,ccity,caddress
I use following code between company and scategory.
Now I want to relate data from category also.
How I will do it.I don't understand the example of n_n_relation
function addresses_management() { $this->load->library('grocery_CRUD'); $crud = new grocery_CRUD(); $crud->set_theme('datatables'); $crud->set_table('company'); $crud->set_relation('scat_id','scategory','sname'); $crud->columns('scat_id','cname','cweb','phone','ccity','ccountry','name'); $crud->display_as('scat_id','Category Name'); $crud->display_as('cname','Company Name'); $crud->display_as('cweb','Website'); $crud->set_subject('Company'); $output = $crud->render(); $this->_example_output($output); }