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.

Link to comment
Share on other sites

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.

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.