Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL table logging

Status
Not open for further replies.

ThinkGeekness

Technical User
Jan 20, 2003
55
0
0
US
Is there a way to output MySQL logs using php onto a page? What I want to do is have MySQL log whenever somebody makes a change to a table (does it by default do that?) and then output it using php.

Here is what I am hoping for to be able to log:

I have a cms where different users can edit their specified content. I want to keep track of what the users edit and when. And if possible, I want to know what they edited from (in case there is a mistake). Also if it is possible I would like to log when the user logs in/off (using php sessions with MySQL).

Thanks

 
you can create a log table which keep track of every change submitted. you can make a description in the form 2 times. one time hidden with name "originaltext" and one time visible with name "newtext"

after submit you just insert all the stuff also in your log table



 
and when a user logs in is easy with sessions. but when you don't have a specific logout it's hard to tell when a user is logged off. if I go to the toilet for a minute , does that means that I'm logged off ??

 
Thanks for your reply. Do you have any specific code that I can try?

And for the logout, I have a logout script that actually logs you out, so that shouldn't be a problem. I am more worried about the logging of the changes and who logs in when.

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top