Just wanted to know if say thousands of values could automatically change in a SQL database per 24 hours from the time that value was set. For example if I set a value of 7 at 21:00 (last 7 days) once that value get to 0 at 21:00 every time a user logs back in can you set a function to prompt them their times up or is this to complicated for a simple SQL database?
I'm not sure if a database can do that, but I think it would be better just to keep a record of the user's last login time in epoch seconds, and then when they go to login again, check the difference between the seconds at that time and their last login -- if it's over 7 days, then direct them to a login screen. You can update thousands of SQL records via a cron job and a simple script, but that's wasteful, in my opinion. I'm not sure what you're using, but in perl, it'd be something like this: $seven_days = 60*60*24*7; # 60 seconds * 60 minutes * 24 hours * 7 days $now = time(); # perl's time that uses epoch seconds $max_oktime = $now-$seven_days; # getting the max_ok seconds for an active session ## get user login info from database (when they try to access the site) select * from user_info where user_id=$id ... $last_login = $row->last_login if ($last_login < $max_oktime) { ## they must login again } else { ### They're ok to move forward } Code (markup): That's not complete, but it should give you an idea of how to proceed. Alternately, if your script is too complicated to add a new column to a database table, you can always create a new table dedicated to login times, then just be sure to update that with the user's unique identifier, set the last_login time to today just to be safe.. Also, though, you'll have to update the last_login time to $now (epoch seconds) when they login. If you're comfortable with code it's a pretty easy process, but it also should be fairly inexpensive to get a programmer to do it for you if you're not familiar / comfortable with it.