PHP Undo Redo commands for database operations