⚠ 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

Problem with saving n-n relation



alain
  • profile picture
  • Member

Posted 12 February 2014 - 15: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


alain
  • profile picture
  • Member

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