Skip to main content
Participant
October 13, 2006
Answered

Storing User Events in MySQL

  • October 13, 2006
  • 2 replies
  • 468 views
I need to store logged in users' changes to various records in tables available to them. What is the best procedure to do so? Create a seperate table and update on changes?
This topic has been closed for replies.
Correct answer Sankalan
If you want to keep a track of all the user's logged in and maintain record in DB then you can create a new table for that purpose.
When a user logs in you can insert a row in to that table and can access that row later to update for the subsequent operations through the PK. Else you can insert the session id into the table and can use the session id column as PK.
If you don't need the user records in future for you reference then you can delete the inserted row when the session ends.

Thanks

Sankalan
(www.mindfiresolutions.com)

2 replies

Inspiring
October 16, 2006
If mySql supports triggers ( I don't use it so I don't know), that might be the way to go.
SankalanCorrect answer
Participating Frequently
October 16, 2006
If you want to keep a track of all the user's logged in and maintain record in DB then you can create a new table for that purpose.
When a user logs in you can insert a row in to that table and can access that row later to update for the subsequent operations through the PK. Else you can insert the session id into the table and can use the session id column as PK.
If you don't need the user records in future for you reference then you can delete the inserted row when the session ends.

Thanks

Sankalan
(www.mindfiresolutions.com)