Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6177637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:18:41+00:00 2026-05-24T00:18:41+00:00

I need to be able to delete messages and to restore them until the

  • 0

I need to be able to delete messages and to restore them until the page is not reloaded. So I have a field ‘is_deleted’ in my ‘messages’ table. What I want is to delete these ‘deleted’ records after it. What would be the best solution for this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:18:42+00:00Added an answer on May 24, 2026 at 12:18 am

    It depends on your needs, a “purge” button may be what you want or a lot of times people will use a cron job and set the is_deleted to be a Nullable DATETIME field, if after x days, it still shows as being deleted, it is automatically deleted from the database.

    So if the automatic way appeals to you and you are on linux look at Cron jobs or if on windows Task Scheduler. If you would like an example of the cron, I need to know how frequently you would want the records purged from the system and I will provide you with an example of one.

    For example, to run the delete script every 5 minutes:

    */5 * * * * /usr/bin/php -f /path/to/script/purgeDeleted.php > /dev/null
    

    You will still have to write the purgeDeleted.php script, but that is the setup for running a php cli script via a cron job in Linux.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Java is the key here. I need to be able to delete files but
I need to be able to get at the full URL of the page
I have a page where I am dynamically creating an asp.net table. At some
I need to IMPLEMENT(not to use some library/open source) an event/message system. I have
I need to be able to delete a user account from a database on
I have pages of data, pulled from a database. I need to be able
I need to be able to delete a line based on specific text in
I have a form that has many contacts. I want to be able to
Users of the website need to able to store images in their area ,
Need to be able to pull Magento products into an external template. Need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.