Impossible many to many relation, perhaps a working way to be checked...
Posted: 2015-09-28 06:25
Hello, i absolutely need to create a many to many relationship.
My database is used as a professional contents directory (video, books, audio, articles, authors, publishers, comments => as tables).
The fact is : i want to link contents among each other. For instance, inside a video or an audio content, one or many book(s), or other video, audio articles (...) can be quoted. So there is here a many to many relationship : many contents of any type are linked to many other contents.
The idea is :
When a user registers a new content (e.g : a video) he just should have to add child contents (here, for instance, the books, articles that the video talks about). The issue is : I tried everything but i couldn't manage to raise that issue (problem of circular reference when i add a lookup in each table to all other tables).
I for instance tried to create a lookup that looks in many table (with the button advanced), but it doesn't work...could Ahmar help me on that point ?
And, in addition to that, there must be absolutely no duplicates on the fields Title and URL (for audio /video / article contents)
I've got an idea to solve that :
Creating a table "relations_between_contents" with many lookups :
id_relation
type_of_first_content => this field should be a radio option in order to let the user choose what lookup to use (what table to search in) for content#1
video_tolink => lookup
audio_tolink => lookup
article_tolink => lookup
book_tolink => lookup
...
type_of_second_content => this field should be a radio option in order to let the user choose what lookup to use (what table to search in) for content#2
video_tobelinked => lookup
audio_tobelinked => lookup
article_tobelinked => lookup
book_tobelinked => lookup
...
=> But that way requires to hide some lookup fields (for ID# xxx, the user could only link a content to another : e.g : video_link <=> book_tobelinked)
It's absolutely not practical and not very simple for the users, they have to register a new content, its children, and then to separately indicate links between contents through another table...
Any ideas ?
Thanks in advance.
My database is used as a professional contents directory (video, books, audio, articles, authors, publishers, comments => as tables).
The fact is : i want to link contents among each other. For instance, inside a video or an audio content, one or many book(s), or other video, audio articles (...) can be quoted. So there is here a many to many relationship : many contents of any type are linked to many other contents.
The idea is :
When a user registers a new content (e.g : a video) he just should have to add child contents (here, for instance, the books, articles that the video talks about). The issue is : I tried everything but i couldn't manage to raise that issue (problem of circular reference when i add a lookup in each table to all other tables).
I for instance tried to create a lookup that looks in many table (with the button advanced), but it doesn't work...could Ahmar help me on that point ?
And, in addition to that, there must be absolutely no duplicates on the fields Title and URL (for audio /video / article contents)
I've got an idea to solve that :
Creating a table "relations_between_contents" with many lookups :
id_relation
type_of_first_content => this field should be a radio option in order to let the user choose what lookup to use (what table to search in) for content#1
video_tolink => lookup
audio_tolink => lookup
article_tolink => lookup
book_tolink => lookup
...
type_of_second_content => this field should be a radio option in order to let the user choose what lookup to use (what table to search in) for content#2
video_tobelinked => lookup
audio_tobelinked => lookup
article_tobelinked => lookup
book_tobelinked => lookup
...
=> But that way requires to hide some lookup fields (for ID# xxx, the user could only link a content to another : e.g : video_link <=> book_tobelinked)
It's absolutely not practical and not very simple for the users, they have to register a new content, its children, and then to separately indicate links between contents through another table...
Any ideas ?
Thanks in advance.