Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341 E-mail: je...@gii.co.jp Web site: www.the-infoshop.com >-----Original Message----- >From: Patrice Olivier-Wilson [mailto:b...@biz-comm.com] >Sent: Friday, September 10, 2010 12:09 PM >To: mysql@lists.mysql.com >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=je...@gii.co.jp -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org