Here is what Im trying to do:
Im building a private messaging system, which is threaded (like in facebook pretty much). Im stuck on the deletion portion.
Both members of the conversation can delete the conversation thread from their inbox, but you obviously cannot delete it from the DB, because it will disappear for the 2nd person as well. So I created 2 columns, sender_del and receiver_del. When the sender of the thread deletes it, sender_del gets set to 1. If receiver deletes it, receiver_del gets set to 1. But then you need to display the list of PMs and not include the PMs which have receiver_del or sender_del set to 1, but the messages are all mixed together, since for some you are the sender, for others the receiver, so you can just say SELECT * FROM pm WHERE receiver_del == 0 OR sender_del == 0
What would be a good solution for this problem?
Im building a private messaging system, which is threaded (like in facebook pretty much). Im stuck on the deletion portion.
Both members of the conversation can delete the conversation thread from their inbox, but you obviously cannot delete it from the DB, because it will disappear for the 2nd person as well. So I created 2 columns, sender_del and receiver_del. When the sender of the thread deletes it, sender_del gets set to 1. If receiver deletes it, receiver_del gets set to 1. But then you need to display the list of PMs and not include the PMs which have receiver_del or sender_del set to 1, but the messages are all mixed together, since for some you are the sender, for others the receiver, so you can just say SELECT * FROM pm WHERE receiver_del == 0 OR sender_del == 0
What would be a good solution for this problem?