|
Private Messaging
I am currently looking into the possibility of building a basic messaging system into my new website but im a little unsure of how to do it.
At the moment I have one table in my DB with the following items:
MessageID (primary key)
MemberID (foreign key linking to Members table)
From (member username using a lookup on MemberID)
To (recipient MemberID but displaying username using a lookup query)
Subject
Message
SentDate (auto date timestamp)
MessageRead
Ok so the way I plan to do it is when the user looks at the persons profile they will get a link that says Message Member (or something along those lines). This will take them to an insert form they can fill in and submit.
The From field will get the MemberID from the session and the To field will get its value from a GET function on the URL.
The person their sending it to will have an inbox which will pick up any messages (read or unread). When they open the message it will automatically update the MessageRead field and change the status of the message.
Each user will also have a Sent folder displaying all messages they have sent to other users.
I think this can all be done from the one table but can anyone suggest any better ways of doing it or point out anything I may have missed?
Thanks, Dave
|