0

I'm in the middle of building CMS/CRM for my company using CodeIgniter and I need a way to add deleted items to a trash queue.

So how would you approach the problem of removing a record on delete and placing it in another table? I would also require a way to re-instate the record from the trash queue.

Any thoughts on this would be very much welcomed. Thanks.

4

1 回答 1

1

I would just use a column on your table called deleted TINYINT(1) That way you could just flag it as being deleted and you don't need to move it to any other table. So you would just update the record instead of deleting it. UPDATE table_name SET deleted = 1 WHERE id = 1

于 2013-02-27T18:37:00.353 回答