Jump to content

Archived

This topic is now archived and is closed to further replies.

jaymc

PM system

Recommended Posts

I'm about to start making a PM system for my website

Before I do, just wondering if anyone has any tips or things to concidered before creating the database structure

To 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 ID

is that the best way?

Share this post


Link to post
Share on other sites
What about multiple recipients, and replies?

Share this post


Link to post
Share on other sites
replies would be sent into the same table

send = senders ID
to = to ID

That would be logical right?

Share this post


Link to post
Share on other sites
Sure, I guess... so you wouldn't handle multiple toIDs separately?

Share this post


Link to post
Share on other sites
I dont get what you mean?

Like a mass mail?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
I wouldnt allow normal users to send out mass mails, But I am going to have it allowed for admin

Share this post


Link to post
Share on other sites
No, I meant how do you plan to represent this in the DB?

Share this post


Link to post
Share on other sites
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 member

So, 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 Admin

Sound the logic?

Here is the Structure

[code]
ID
TO
FROM
DATE
MESSAGE
IP
ATTATCH[/code]

Any suggestions for another field I may want to include?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.