⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠


profile picture

set_relation_n_n - retrieve information from another table


  • profile picture
  • Member

Posted 22 November 2019 - 13:37 PM



i have some difficulties to find the solution to solve my problem.

i am using set_relation_n_n function between tables registration (inscriptions), and financial transaction (transact).

One financial transaction can address one or more registration, transact_inscription is the relation table

It is working fine but instead of showing member id (adherents_id) , i would like to show the member name (nom) ,  information stored into table adherents

How can i manage it ?

My code below. i attached ERD diagram

Many thanks for your help.



<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Transactions extends CI_Controller {

function __construct()

         /* Standard Libraries of codeigniter are required */
         /* ------------------ */



public function show()
        $crud = new grocery_CRUD();
        $crud->set_relation_n_n('adherent','transact_inscription','inscriptions','transact_id','inscription_id','{adherents_id} {cotisation}', 'priority');

        $output = $crud->render();


function _example_output($output = null)

        $this->template->set('title', 'Gestion des Transactions');
        // on charge la page dans le template
        $this->template->load('template', 'transactions', $output);