5
I have the following tables:
- Table: Customers
- Table: Interests of the client
- Table: User
In the client interests table, I need to enter the user id and the client id as foreign keys, the user id I’ll get from a Session.
I need to know, if when created the relationship with the respective indexes, the client id is dynamically inserted in the table client interests as foreign key?
If you don’t create one trigger or procedure in the database, no. The constraint serves as a limiter of that field to accept only data contained in the column of the table to which it is being referenced.
– user28595
That’s why I use frameworks like
Laravel 4
. You’ll probably have to take a walk to do that, buddy. You’ll probably have to do aTRIGGER
– Wallace Maxters