How to keep history of record updates in MySQL?

后端 未结 6 804
南旧
南旧 2020-12-23 12:36

I have to create a code in PHP that will allow me to keep the history of record updates in MySQL database so I can find by date an old revision.

Here is the example

6条回答
  •  旧巷少年郎
    2020-12-23 12:38

    The easiest solution (depending on your specific needs) would probably be to add an on update/insert/delete trigger to your table, so you can perform extra logging when data is inserted/updated/deleted. That way even manual interventions on the db will be covered...

    Check http://dev.mysql.com/doc/refman/5.1/en/triggers.html for more information.

提交回复
热议问题