MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 2012, 12:59 AM
sukhwindersingh sukhwindersingh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 2 sukhwindersingh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 56 sec
Reputation Power: 0
Multiple many-many relations between two mysql tables

I have two Main tables, Post and User, I am facing issue of multiple relations as per requirement given bellow:

A Post Belongs to a User.
A Post may be addressed to one or Many Users
Users can follow a Post to receive notification when there is some reply/comment on a post.
A User can add a Post to his ToDo list and when he completes this ToDo he can mark this ToDo Done (so this ToDo be removed from his ToDo list)
Users Should get notification when a post is addressed to a User, or when some reply/comment is given on Post the User is Following. (A user who create the Post , or A user who is addressed in Post, will be automatically following that Post).

So This way i need to create different many many relations ships between Post and User tables, so do i Need to create a different joining table for each relation? like Post_user_follower(id,PostId,UserId) to save the data of Users who are following some Post, and so on for each relation, is this a normal case or there will be circular joins creating infinite loops?
can i save additional data in the joins tables along with the Id's of joining tables e.g for ToDO's, i will create a table Pots_user_toDo (id,userId,PostId,toDo_status) so that i can save the status of ToDO in the join table to check whether the ToDO is pending or completed, or i need to save the ToDo_status in another tables e.g ToDo(id,toDO_status)

Please guide
Regards

Reply With Quote
  #2  
Old December 10th, 2012, 01:24 AM
sukhwindersingh sukhwindersingh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 2 sukhwindersingh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 56 sec
Reputation Power: 0
Kindly help

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Multiple many-many relations between two mysql tables

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap