PDA

View Full Version : idea behind creating a user messaging system


gavimobile
10-26-2008, 07:37 PM
folks, i need some advice about creating a email sort of system but this is not actually email.

ive created a table with the following columns,
mail_user, mail_from, mail_to, mail_subject, mail_msg, mail_date, mail_status

when composing a message
mail_status is valued and inserted into table as "sent" (hidden) so i can select sent messages from sender
however
since one row has been inserted with a value of "sent"
i will not be able to select rows for recipiant because status is equal to sent.

i was thinking about having the script create another insert query except with the status unread.
so i can select it from the recipitents side (inbox)

also if sender deleted sent message, it shouldnt delete the message from the recipiant.

is it convient to make 2 inserts? will this be drain gobble memory from my server?
what is another way of going about this?

hope i was clear!

thanks in advance!
gavi