Jump to content


How to update a n n relation table via an other table

relation relation_n_n update table set_relation_n_n

  • Please log in to reply
4 replies to this topic

#1 Sitraka Razafimamy

Sitraka Razafimamy

    Newbie

  • Members
  • Pip
  • 3 posts
  • LocationMadagascar

Posted 07 May 2013 - 11:11 AM

Hi
 
I'm new, I have a  question. Is it possible to create a relation_n_n that contains data (date, for example) you must update.
 
I show you an example:
 
I have 2 tables
Employe (id_employe, nom, prenom)
Action(id_action, type, libelle)
 
and the relation table
EmployeAction (id_employe, id_action, date)
 
I would like to update the  "EmployeAction" table from the "Employe" table.
Is this possible with set_relation_n_n () function? How?
 
Can you help me please!!!


#2 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts
  • LocationAthens, Greece

Posted 07 May 2013 - 02:10 PM

Hello and welcome to the forums.

Actually this has nothing to do with the fact that you are using a set_relation_n_n.

At your employe table you use one (or all) of these functions:

before_insert

after_insert

before_update

after_update

 

Which one(s) you use and what you do within these callbacks it depends on the logic you want to implement.


____________________________________________________________

 

rtfm_small.jpg---!!!Please read these guidelines before asking to the forums!!!---

____________________________________________________________

 

David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr


#3 Sitraka Razafimamy

Sitraka Razafimamy

    Newbie

  • Members
  • Pip
  • 3 posts
  • LocationMadagascar

Posted 07 May 2013 - 03:07 PM

Thank you for your welcome and your reply. I will use one of these functions.  :)



#4 victor

victor

    grocery CRUD Hero

  • Advanced Member
  • PipPipPip
  • 967 posts
  • LocationMinsk

Posted 07 May 2013 - 03:12 PM

You should try each of all functions from the API page before you will make the project. you will be spent a little time but then you won't have any questions. Really, it will save your time.

#5 Sitraka Razafimamy

Sitraka Razafimamy

    Newbie

  • Members
  • Pip
  • 3 posts
  • LocationMadagascar

Posted 07 May 2013 - 03:43 PM

You are right, I 'll try each of all functions from th API. If I encounter some problems, I think I always ask for a little assistance.







Also tagged with one or more of these keywords: relation, relation_n_n, update table, set_relation_n_n

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users