jgd1234567
Programmer
Hi, i have the following tables:-
NewsArticles (for my news section):
- ArticleID (PK)
- Message
...
Products (for my products section):
- ProductID (PK)
- Title
...
I need to add a comments facility to both my news and products sections. I don't wish to create seperate tables for each as i would then need to have two seperate ways of moderating these tables unless i do a union which is not particularly ellegant. Also i may add additional sections later and don't wish to add unions around my whole site where i wish to display both the products and news comments together. One solution is to create a table:
Comments:
- CommentID (PK)
- TableID (FK)
- Comment
But now i can't add a relationship to both tables.
I'm sure this is a common problem and would appreciate some help.
Thanks
NewsArticles (for my news section):
- ArticleID (PK)
- Message
...
Products (for my products section):
- ProductID (PK)
- Title
...
I need to add a comments facility to both my news and products sections. I don't wish to create seperate tables for each as i would then need to have two seperate ways of moderating these tables unless i do a union which is not particularly ellegant. Also i may add additional sections later and don't wish to add unions around my whole site where i wish to display both the products and news comments together. One solution is to create a table:
Comments:
- CommentID (PK)
- TableID (FK)
- Comment
But now i can't add a relationship to both tables.
I'm sure this is a common problem and would appreciate some help.
Thanks