For anyone familiar with tables (MySQL) ...
I'm trying to set up a many-to-many relationship within the same table. Basically I have record 'related' to each other. I'd like to show, in the record view page, which other records are related to the one you are viewing, and be able to click over to them. The records are not distinct enough to have their own tables, but we will sometimes use a record as a reference for the development of another record.
As an example, let's say we have a table of Movie titles. You want to have a tab for related movies ...
The join table fields could be related_ID, from_ID, to_ID
If we have two movies in a table called Movies...
movie_ID, name
1, Back to the Future
2, Back to the Future 2
And a join table called MovieRelated looks like:
related_ID, from_ID, to_ID
1, 1, 2
We add a relationship to the tables/Movies/relationships.ini ...
[Related Movies]
Movies.movie_ID = MovieRelated.from_ID
MovieRelated.to_ID = "$movie_ID"
Should this not work? It doesn't seem to in my case. In the fields.ini and valuelists.ini, I have a query/vocabulary setup that uses a better field in place of the ID's, and it works on another table (that doesn't join back to itself). What I get on this one is a blank dropdown list.
Is there a specific way to do this, or is it possible to do it this way (this simply)? This should at least be a one-to-many relationship, but it would be even better if it worked both ways in one record.
Thanks,
Rory