Reply to internal messaging

Your name:

Reply:


Posted by Mike on 09/26/42 11:52

Hi,

I'm working on an internal messaging within a website.

Basically, it will be like email but internal so a user logs in to the
site and can send a message to another user who has access to the site.
When a user logs into the site and visits their profile page, they can
see if they have any messages and choose to read, reply or delete. All
the messages are to be stored in a db.

I've thought of a way to do it by creating 1 table with the following
fields..

Unique id - increments on every new message
sender_id - taken from the id of the logged in person
receiver_id - taken from the id of the person he is sending to
subject - message subject
message - message body
read - flag to show if receiver has read the message or not
date_added - date the message is sent
reply_id - the unique_id of the message this message is a reply too, if
at all

So if a new message is created, all the above will be filled in apart
from the reply_id.

If the receiver replys then the reply_id will reference the message it
is responding to.

Then by various searches, all messages can be shown, including any
previous relating messages.

Although I have only planned it on paper, the logic seems to work
except I can't think of a way for a user to delete a message.

As replys are read by the sender and the receiver, if the sender
deletes a message the reciever will then not see that particular
message.

I did think that rather than having a reply_id, the reply message
simply takes the pervious message and adds it to the string but I
though this would duplicate data in the database.

Is there another way to set up this type of system?

Many Thanks

Mike

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация