JohnOP Posted August 8, 2011 Share Posted August 8, 2011 This is more of a question to see if this is the best way of doing this. I have a friends list of my website that i am making and want to show the user when there friends were last on line. I have a column in the friends table with there friends last login time which gets updated when they login and then i format it and present it to the user viewing, is that the correct way of doing? Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 8, 2011 Share Posted August 8, 2011 it's one way... but if they logged in at 9 am, and are still online 10 hours later, their friends will think they were last online at 9 am, which is not true. I normally store the last activity time, rather than the login time. Quote Link to comment Share on other sites More sharing options...
JohnOP Posted August 8, 2011 Author Share Posted August 8, 2011 Wouldn't that mean i have to update there table on every page they go to causing page load? Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 8, 2011 Share Posted August 8, 2011 yep, but you can just create a function to do that, something like updateTimestamp() and include it at the top of each file. all it will do is grab a timestamp and update 1 database field. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.