Paul_Bunyan Posted August 12, 2008 Share Posted August 12, 2008 Hi all. I'm maintaining a database of engineers with some php pages linked to an Oracle database. I would like to be able to maintain a record of how long it has been since a user has last logged in to update their profile and if it has been a year automatically send them a notification. I'm not sure how to implement a timer that would check each users profiles. I was just hoping that someone could suggest an approach as I haven't as of yet figured out how to tackle this. Thanks in advance for any ideas. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted August 12, 2008 Share Posted August 12, 2008 Well, it sounds like you've actually got two separate questions. To display the time since last login on their profile, it would be a simple case of selecting the last login from the database (that is, of course, assuming you have this data. Otherwise, you can't do it) and taking it away from the current date. As for sending notifications after a year of inactivity, your best bet is a cronjob. The idea is that you set a php script to run every so often, which would select engineers who have not logged in during the last year. You'll have to decide how frequently you'd like this to run. Given the timescale, I guess every week or so would be adequate. So, i suggest you readup on cronjobs. Quote Link to comment Share on other sites More sharing options...
Paul_Bunyan Posted August 12, 2008 Author Share Posted August 12, 2008 Thank you! Cronjobs will do just what I need! 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.