List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:September 10 2010 4:31pm
Subject:RE: newbie question database tables
View as plain text  
Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@stripped
Web site: www.the-infoshop.com

>-----Original Message-----
>From: Patrice Olivier-Wilson [mailto:biz@stripped]
>Sent: Friday, September 10, 2010 12:09 PM
>To: mysql@stripped
>Subject: newbie question database tables
>
>I'm working on a database that needs to do a few things and getting
>brain freeze on one part.
>
>Scenario:
>
>
>I want to compile a db of articles with these tables:
>
>Categories
>Topics
>Users
>
>Categories
>
>
>cat_ID | cat_name
>
>
>Topics
>
>top_ID | top_name  | top_content | cat_ID
>
>
>Users
>
>user_ID | user_name | top_ID
>or
>user_ID | user_name | top_ID | top_IDb | top_IDc etc....
>
>(output to web page using php)
>
>But I need to show which users are using which topics, and I can add
>top_ID to the user file, which is fine if they are only using one topic.
>
[JS] What you need is another table, users_topic:

users_topics: user_ID | top_ID

and get rid of the top_ID field from the users table.

That's the general technique to use when you need a cross-reference.


>I could add 5 different topic to each user, but then I couldn't expand
>later.
>
>Reverse is true if I add user_ID to the Topics.
>
>So, need an idea how to solve this so it doesn't matter how many new
>users I keep adding, I can still see who is using the topics.
>
>As I said, a newbie question. Thanks much.
>--
>Patrice Olivier-Wilson
>http://biz-comm.com
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1




Thread
newbie question database tablesPatrice Olivier-Wilson10 Sep
  • RE: newbie question database tablesJerry Schwartz10 Sep
    • Re: newbie question database tablesPatrice Olivier-Wilson10 Sep
  • Re: newbie question database tablesPatrice Olivier-Wilson11 Sep