2 sample records.
Code: Select all
id | message_id | from_id | to_id | folder_id
---------------------------------------------------
1 | 834 | 1 | 2 | 2
---------------------------------------------------
2 | 834 | 1 | 2 | 1
---------------------------------------------------The receiver now has a pending message in folder_id 1... the inbox.
Now, I want to have a "delete all" option for my users to delete all the messages from their outbox. Obviously I would need to delete both records.
I can take care of the first one quite easily with this query.
Code: Select all
DELETE FROM `privatemessages_data` WHERE `from_id` = '$user_logged_in' AND `folder_id` = 2