Hi,
I'm making a site that's going to have a many-to-many relationship, and was wondering if anyone else had thoughts on how to implement this - both in terms of the database, and about how to input it.
What do I mean?
I'm using CCK to have node references in my node edit pages - so I have one node type of 'organisation' and another of 'project' - and so I can select multiple projects in any organisation I'm editing.
Which is great: but what I need is, for each project added, extra fields that relate to that project's connection to the organisation. I.e. When i add a project to an organisation, I need more fields to appear - in my case, I need "amount this organisation gives to this project" (in either a negative or positive amount to indicate giving or receiving funds from it.)
In relational database terms, this is a many-to-many relationship - one organisation can be involved in many projects / one project can involve many organisations - which relational databases can't do directly. I need to create a third 'linker' table, I think. An illustrative example (from my database textbook!) would be if you have 'students' and 'courses' -
- one student can be enrolled on zero or many courses
- one course can contain many students
So that's solved by making a third category - registration.