|
ive been looking around for a database stucture that would work well for private messages. here is one that i am thinking about that i wrote myself.
id serial,
from bigint unsigned not null, from user id
from_ip int unsigned not null, from user ip
to bigint unsigned not null, to user id
datesent stamp default current_timestamp, sent timestamp
dateread stamp, read timestamp
deletefrom boolean, whether from user deleted it from sent
deleteto boolean, whether to user deleted it from inbox
subject varchar(255),
text text
inbox would be all messages where user=to column and deleteto=0
sent would be all messages where user=from column and deletefrom=0
then if both deletefrom and delete to == 1 i delete the message
it seems to me that it might work alright, anyone have any suggestions or possibly a better pm system?
also, i have been looking around for a friends type db structure similar to like myspace anyone have any ideas about one.
|