MySQL timestamp stuff

A

Anonymous

Guest
I have a login system using my db and was hoping I could make an active users list, so I need to put a field in the user db which stores when they were last on but I'm not sure how to do that with the MySQL timestamp :?:

What would be a good method for storing the time in my db?
 
Better to have a separate 'logging' table, on each page request insert a record with the userID and time (and whatever else), and to see how many people there are online you can count how many distinct userID's there are in the last x minutes!
 
Back
Top