Jump to content

[SOLVED] Mysql TIME


rempires

Recommended Posts

I'm making a site and i was going to keep track of how long users are logged in, originally i was going to use a TIME field, but my problem is would that be limited to 99hours, 59min 59seconds??  because the thing is users will most likely be logged in for hours at a time, I'm not to worried about this becoming a problem at first but in lets say a year or 2 from know what would happen if somone reached say 100 or more hours, what would mysql do?? should i instead switch to another field type to hold this data?? if somone could just tell me if this field can not handle anything bigger than this it would be appreciated, if somone has a suggestion about what to do instead I'd love to hear that to, as i was going to use a text field since I'll need to handle hours, min, seconds and just separate them with :, use explode in teh php to determine it all

 

thanks, john

Link to comment
Share on other sites

you could use a 2 field system that says logged in, and then Last action page and then a comparrision of those values would get you the result (you can make them in terms of epoch seconds and then you have a results of $loggedininseconds = $lastaction-$loggedin;  Just update the loggedin field when ever they "login" and I'd assume they have to log in when the session are destroyed

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.