Pruning private messages
Posted: Sun May 28, 2006 4:16 pm
Hi everyone,
I have a privae mesasging system that works by storing message information in one table and the actual message in the other. The table that stores information looks like this:
Each of the two users in the conversation has one of these entries. The inbox, sent, and trash take on a value of 1 or 0. Basically, what I want is to delete all entries in this table and all associated entries on my second table when inbox, sent, and trash are set to 0 for both users. My second table tooks like this:
So if I were to send a message from me (id=1) to you (id=2), the entries would be like this:
I can't figure out how to write a query that would delete that when trash, inbox, and sent are 0 for both users. Help appreciated.
Thanks!
I have a privae mesasging system that works by storing message information in one table and the actual message in the other. The table that stores information looks like this:
Code: Select all
convo_id | user_id | inbox | sent | trashCode: Select all
convo_id | messageCode: Select all
Table 1:
12233 | 1 | 1 | 1 | 0
12233 | 2 | 1 | 0 | 0
Table2:
12233 | 'Hey, what's up?'Thanks!