NYCPHP Meetup

NYPHP.org

[nycphp-talk] Undelete mysql records

Matt Juszczak matt at atopia.net
Tue Apr 13 12:06:51 EDT 2010


> I am looking for a way to search all deleted records in a table and undelete
> ones that were deleted by mistake.  Anyone know of an easy way to do this? 
> These are ISAM tables.  Thanks.

By deleted records, do you mean they were deleted with:

DELETE FROM tableName WHERE .... ?

Or something like:

UPDATE tableName set is_deleted = 1 WHERE ... ?

If you deleted them logically, it's a matter of writing the correct SQL 
statement.  If you deleted them physically, good luck, especially with 
MyISAM, unless you had binary logging turned on or backups...

-Matt


More information about the talk mailing list