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.