What should I do with Peng Heping's garbage collection mechanism?

Source: Internet
Author: User
Peng Heping's garbage collection mechanism has a function: After some content is deleted, the original content can be restored. What is the principle? Can you store the items you want to delete in another table. Then, if you want to restore it, update it from another table? $ Sqldelete & nbsp; from & nbsp; '#@__ skupdate_class' & nbsp; where & nbsp; $ bool & nbsp; & Peng Heping garbage collection mechanism
There is a function:
After deleting some content, you can restore the original content. What is the principle?
Can you store the items you want to delete in another table.
Then, if you want to restore it, update it from another table?
$ SQL = "delete from '#@__ skupdate_class' where id =". $ id ."";
$ Bool = $ dsql-> ExecuteNoneQuery ($ SQL );
If (! $ Bool)
{
ShowMsg ("failed to delete course information recycle bin", '-1 ');
Exit ();
} Else {
ShowMsg ("course information recycle bin deleted successfully", 'update _ class. php? Dopost = recycling & page = '. $ page .'');
Exit ();
}

$ SQL = "update' # @__ skupdate_class 'set state = 1 where id =". $ id ."";
$ Bool = $ dsql-> ExecuteNoneQuery ($ SQL );
If (! $ Bool)
{
ShowMsg ("course information recovery failed", '-1 ');
Exit ();
} Else {
ShowMsg ("course information restored successfully", 'update _ class. php? Dopost = recycling & page = '. $ page .'');
Exit ();
}

Which of the following statements have already been deleted?
delete from `#@__skupdate_class` where id=".$id."

Solution

Share: More


------ Solution --------------------
Data table definition status field 0 indicates deletion, 1 indicates activation
When you add data, the status is 1 and when you delete the data, the status is 0.
Recover Data and directly change the status attribute.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.