jaymc Posted October 10, 2006 Share Posted October 10, 2006 I'm about to start making a PM system for my websiteBefore I do, just wondering if anyone has any tips or things to concidered before creating the database structureTo put it simply, Every message sent by a user goes into the 1 table. The way a user gets their own messages is query the database for rows that match their User IDis that the best way? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 10, 2006 Share Posted October 10, 2006 What about multiple recipients, and replies? Quote Link to comment Share on other sites More sharing options...
jaymc Posted October 10, 2006 Author Share Posted October 10, 2006 replies would be sent into the same tablesend = senders IDto = to IDThat would be logical right? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 11, 2006 Share Posted October 11, 2006 Sure, I guess... so you wouldn't handle multiple toIDs separately? Quote Link to comment Share on other sites More sharing options...
jaymc Posted October 12, 2006 Author Share Posted October 12, 2006 I dont get what you mean? Like a mass mail? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 12, 2006 Share Posted October 12, 2006 I mean that if I PM someone, and copy another 6 people, how would this be represented? Or would you system simply not support this? Quote Link to comment Share on other sites More sharing options...
jaymc Posted October 12, 2006 Author Share Posted October 12, 2006 I wouldnt allow normal users to send out mass mails, But I am going to have it allowed for admin Quote Link to comment Share on other sites More sharing options...
fenway Posted October 12, 2006 Share Posted October 12, 2006 No, I meant how do you plan to represent this in the DB? Quote Link to comment Share on other sites More sharing options...
jaymc Posted October 12, 2006 Author Share Posted October 12, 2006 Oh. Well, im not going to allow 'carbon copying' messages for anyone..However, I will have a mass PM for admin. Obviously it would be pointless having the same message in x amount of rows for each memberSo, I was going to set the QUERY to look for all rows which have the TO field matching their username, aswell as querying for any FROM rows that contain 'admin'In other words, the query searches for matches to their username and messages from AdminSound the logic?Here is the Structure[code]IDTOFROMDATEMESSAGEIPATTATCH[/code]Any suggestions for another field I may want to include? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 12, 2006 Share Posted October 12, 2006 That makes sense. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.