I have this mySQL syntax which updates the table users and column skills_mod_time every time the page is reloaded. $sql = "UPDATE users SET skills_mod_time = CURRENT_TIMESTAMP";
How can i change from instead of using the CURRENT_TIMESTAMP to using a counting timestamp.
For example the column skills_mod_time is defaulted as 0. If the page was reloaded 10 sec later, i want the seconds part to be 10. Instead of the current way where it changes 0 to this present time.
It sounds like you want to log “seconds since login”, or something similar, rather than “last activity.” To do this, you should create a column called
login_time, or similar, and only update it when a user logs in. You probably still want to track the last-activity time, as you do now, for the purpose of session expiry.Then if you have these two columns,
login_time, andlast_activity, you can get the seconds between login_time and last_activity by subtracting the one from the other. Or you can get the time since login by subtractinglogin_timefromNOW().I hope this answers your question–if not, please clarify your question.