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 7613383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:08:29+00:00 2026-05-31T02:08:29+00:00

Just curious to see your opinions, as I am developing a forum script alongside

  • 0

Just curious to see your opinions, as I am developing a forum script alongside a coexisting CMS – which i have the ACL etc. sorted.

But was wondering if it is best to do DELETE FROM… (as in delete the record)…or just do an UPDATE to set a column to 1 (bool) – which hides it (so it looks deleted).

PS: only those who I trust have access to moderation tools

  • 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-31T02:08:31+00:00Added an answer on May 31, 2026 at 2:08 am

    That’s up to you and usually a question of how important is the data you are deleting, or how tolerant you want to be with accidents.

    The method I like to use is have a clone database for items you wish to delete. On delete, copy the contents of the selected row to new database, then delete. Having extra “deleted” articles or items in your system is just using up more space and eventually will slow down queries (potentially).

    Once you fill up your “delete articles” database, run a dump, archive, truncate.

    Let’s say you have the database CMS with a table called ARTICLES that you want to store deleted posts, we will create an identical database with the same table structure:

    CREATE DATABASE `deleted`;
    CREATE TABLE deleted.cmsarticles LIKE CMS.ARTICLES;
    

    In your PHP script that’s deleting the content you would do something like this:

    //GRAB THE ID OF THE ARTICLE YOU ARE DELETING, MAKE SURE TO SANITIZE!
    $article_id=$_POST['id'];
    if(is_numeric($article_id) {
        $dbconnect=databaseFunction();
        $result=$dbconnect->query("SELECT `row1`,`row2` FROM `ARTICLES` WHERE `id`=$article_id");
        if($result->num_rows!=0) {
            $row=$result->fetch_array(MYSQLI_ASSOC);
            //Open new connection to deleted database
            $dbconnect2=otherDBFunction();
            $dbconnect2->query("INSERT INTO `cmsarticles`(row1,row2) VALUES ({$row['row1']},{$row['row2']}");
            $dbconnect->query("DELETE FROM `ARTICLES` where `id`={$_POST['id']}");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just curious to see people's opinions: Has anyone thought about implementing the Flash player
Just curious, why can't I have/see my bg img on this span, unless I
Just curious what is the best practice for solving the following issue. I have
Just curious to see if there is a lua way to ping a server
Quick question if I may: I am just curious about the following (see below)
I'm just curious to see what you guys think about this. I heard a
Just curious to see if anyone is using the Abyss Web Server for any
I have just read the following post on SO; Do you source control your
Just curious here: is it possible to invoke a Windows Blue Screen of Death
Just curious: 4 instanceof Number => false new Number(4) instanceof Number => true? Why

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.