| Index
» Projects
» phpMyEdit
» Forum
» Problem with three tables relations |
 |
sidney
Joined: 09 Aug 2004
Posts: 2
Posted: 2004-08-12 13:35
Back to top
Reply with quote
|
Hi everybody,
I'm working for a NGO and I'm using phpmyedit 5.4 to develop a system for managing projects' data stored in Mysql tables.
I have 3 tables (actually they are more but my problem is concerning a three tables relationship)
table1 (partner)
partner_id
partner_name
etc...
table2 (projects)
project_id
project_name
partner_id (from table1)
table3(project+partner)
table3_id
project_id
partner_id
Table3 keeps the relation (wich is many to many) between patrners and projects. A project may have more than one partner and one partner can partecipate to more than one project.
My problem is how to populate and update table3 when inserting, updating or deleting data from the other tables.
I've read the documentation and the forum but I really didnt see any solution.
I'm starting to believe I should use trigger but didnt understand clearly how this should work.
Could someone please give me advice on this topic?
Thank you very much
Giovanna
|
ajh
Joined: 17 Dec 2003
Posts: 236
Posted: 2004-08-12 13:56
Back to top
Reply with quote
|
I think that you will need three forms here.
1. Partner maintenance
2. Project maintenance
3. Partner/Project assignment
1 and 2 are straightforward single table PME forms.
3 is a little more complicated as you will need to use the 'values' option on both the partner and the project fields to list the valid options.
|
sidney
Joined: 09 Aug 2004
Posts: 2
Posted: 2004-08-12 14:13
Back to top
Reply with quote
|
| ajh wrote: |
I think that you will need three forms here.
1. Partner maintenance
2. Project maintenance
3. Partner/Project assignment
1 and 2 are straightforward single table PME forms.
3 is a little more complicated as you will need to use the 'values' option on both the partner and the project fields to list the valid options. |
I've build a form for partner wich insert,update, etc data in table 'partner' but I was thinking about doing step 2 and 3 at the same time, that is when I insert project's data.
A third form could also be a solution but I still cant see how to build it in a way that insert or update data without human intervention.
Giovanna
|
|
Post new topic
Reply to topic
|
|
|
|