About Moving deleted messages to trash

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
anushal
Forum Newbie
Posts: 6
Joined: Thu Sep 11, 2008 6:28 am

About Moving deleted messages to trash

Post by anushal »

hai....can u please help me out

How can i fetch the deleted messages and display them in a trash page.

Thanku in advance
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Re: About Moving deleted messages to trash

Post by Stryks »

How did you go with your last post? That code help at all?

As for how to do this, I think I'd probably just add another field in the messages table named 'deleted'. Just a boolean, or a 1 length tinyint that you'll set to either 1 or 0. When the user hits delete as per the previous post, just set the 'deleted' column to true or 1, depending on what method you want to go with.

Then when you display messages, show only messages where deleted = false. You could create a trash view by showing messages where deleted = true. And you could 'empty' the trash by saying delete where deleted=true.

Hope that helps.

Cheers
anushal
Forum Newbie
Posts: 6
Joined: Thu Sep 11, 2008 6:28 am

Re: About Moving deleted messages to trash

Post by anushal »

hi....in the last code there was a small variable missing in the delete file..i verified that n got out with the output.
Post Reply