Jump to content


Problem with saving n-n relation


  • Please log in to reply
1 reply to this topic

#1 alain

alain

    Member

  • Members
  • PipPip
  • 22 posts

Posted 12 February 2014 - 03:26 PM

Hi!

 

The relation n-n of my tables is like following:

entreprisespersonnes.jpg

 

And my code is:

$crud->set_relation_n_n('listePersonnes', 'entreprisespersonnes', 'personnes', 'entreprisespersonnes.IdEntreprise', 'IdPersonne', 'Nom', 'IdPersonne');

But when I save the form, there is error in the line created in the association table (entreprisespersonnes)! IdPersonne is always 'zero'

 

Is it because my primary keys are all named 'id' ???

 

Alain



#2 alain

alain

    Member

  • Members
  • PipPip
  • 22 posts

Posted 13 February 2014 - 07:35 AM

I remove the 7th parameter of the method

$crud->set_relation_n_n('listePersonnes', 'entreprisespersonnes', 'personnes', 'entreprisespersonnes.IdEntreprise', 'IdPersonne', 'Nom', 'IdPersonne');

So it works now but I wonder what is the role of this 7th argument?

The display is no more ui-multiselect but choosen






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users