littlevisuals Posted July 13, 2009 Share Posted July 13, 2009 Hi all I have a question if you may, im currently building a simple cms. There will be an admin and a few users, but I would like there to be a section where it displays logs/changes to the database. I have looked through google and bing for an answer and the only way I can think of is inserting datestamps in all my tables but no idea for users? :-\ Is there a log built into mysql which I could call? If not whats my best option? ??? Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/165855-solved-how-easy-is-it-to-log-changes-to-data-made-by-a-user-and-display-in-php/ Share on other sites More sharing options...
littlevisuals Posted July 13, 2009 Author Share Posted July 13, 2009 TLDR; Best way to log user actions (what stuff they change/amend etc) Link to comment https://forums.phpfreaks.com/topic/165855-solved-how-easy-is-it-to-log-changes-to-data-made-by-a-user-and-display-in-php/#findComment-874862 Share on other sites More sharing options...
PFMaBiSmAd Posted July 13, 2009 Share Posted July 13, 2009 The mysql query log (when it is enabled) only shows the queries and the client username that was used in the connection to the database server. The database has no idea what actual user on your site is causing anything to happen. You will need to add code in your application to log the information you want. You can either log to a file error_log or log information to a database table. Link to comment https://forums.phpfreaks.com/topic/165855-solved-how-easy-is-it-to-log-changes-to-data-made-by-a-user-and-display-in-php/#findComment-874874 Share on other sites More sharing options...
littlevisuals Posted July 13, 2009 Author Share Posted July 13, 2009 Thanks PFMaBiSmAd! Link to comment https://forums.phpfreaks.com/topic/165855-solved-how-easy-is-it-to-log-changes-to-data-made-by-a-user-and-display-in-php/#findComment-874879 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.