PHP Classes

Keep edit and delete database archive: Access tables keeping deleted records archived

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 584 This week: 1All time: 5,296 This week: 78Up
Version License PHP version Categories
archive-edit-delete 1.0GNU General Publi...5.0PHP 5, Databases


This class can access MySQL tables keeping deleted records archived.

It can execute common queries to manipulate records of a MySQL table but record deletion is emulated by setting a field with the data of the soft-deletion of the record.

The class can execute SQL INSERT, UPDATE, DELETE and SELECT queries ignoring rows there are soft-deleted.

Innovation Award
PHP Programming Innovation award winner
January 2013
Permanently deleting database records may be a dangerous operation to execute from an application.

If a Web site that performs record deletion has its user accounts compromised, the attacker may cause irreversible damage by executing operations that delete important information records.

A more secure alternative is to implement what is called soft-deletion of records.

In practice this means that records are not really deleted. Instead they have a field that is used to mark deleted records.

This way, if there is a security breach and records are marked as deleted, the records that were affected may be undeleted.

This class implements access to MySQL database table records with soft-deletion support.

The delete operation just sets the field to mark the records as deleted. The table access operations ignore records marked as deleted.

Manuel Lemos
Picture of majid ramzani
Name: majid ramzani <contact>
Classes: 4 packages by
Country: Iran Iran
Age: 32
All time rank: 126114 in Iran Iran
Week rank: 95 Up3 in Iran Iran Up
Innovation award
Innovation award
Nominee: 1x

Winner: 1x


to use: first: add a database and table to test the class : (the news table is attached.) then : run some insert query to insert some row to that table (insert function of this class) then try to delete or edit some row throw this class. yeah , it works !

  Files folder image Files  
File Role Description
Accessible without login Plain text file index.php Example usage
Plain text file KEDA.class.php Class class file
Accessible without login Plain text file news.sql Data table structure
Accessible without login Plain text file readme.txt Doc. read me

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:5,296
This week:78Up