Jump to content

[SOLVED] implementing a timer for database spring cleaning


Paul_Bunyan

Recommended Posts

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.