简体   繁体   English

使用php和Mysql跟踪数据库使用情况

[英]Tracking database usage using php and Mysql

I am designing a php mysql webapp. 我正在设计一个php mysql webapp。 In that, a database usage log has to be maintained , which will record 1.User ip 2.Timestamp 3.operation performed(Add,edit or delete) 4.Colmns changed 5.rowid 6.old value 7.new value 其中,必须维护数据库使用日志,该日志将记录1.User ip 2.Timestamp 3.已执行的操作(添加,编辑或删除)4.Colmns已更改5.rowid 6.old值7.new值

Please suggest any example scripts. 请提出任何示例脚本。

If you are using your own database class, just add this logging to that class. 如果您使用自己的数据库类,只需将此日志添加到该类中。 Otherwise you will have to make a database class to do it and start using that class instead of using mysql_query directly. 否则,您将必须创建一个数据库类来做到这一点,然后开始使用该类,而不是直接使用mysql_query

There are many DB profilers available. 有许多可用的数据库探查器。 You can configure that and use them. 您可以配置并使用它们。 You can use XDebug. 您可以使用XDebug。

Another link : http://particletree.com/features/php-quick-profiler/ 另一个链接: http : //particletree.com/features/php-quick-profiler/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM