SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Automate Script

  1. #1
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Automate Script

    Hi, my site needs to carry out daily checks on user's accounts and then carry out an action depending on the result. It needs to check the following things on a daily basis:

    - check if a new member has updated their profile within 7 days (IF $create_timestamp is > than 7 days and $profile_update = no WHERE user = $user, then email the $user)

    - check if a member has added their daily post (IF $today_post = no WHERE user = $user, then email the $user)

    - etc...

    There are about 5 checks that need to be carried out each day, however, because all of my members are from different timezones, i want to carry out these checks every hour as i only want to query the users who's day has just started (00:01)

    QUESTION
    Is running a CRON file with these 5 queries (checks) the best way to make these checks or is there a more solid or better way of doing this, thanks in advance...

  2. #2
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Set a CRON to run the script every hour and process only those members whose timezone is 00h00
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  3. #3
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ha, thanks for your reply, that's what I said I was going to do

  4. #4
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Voila !!!
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  5. #5
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool, thanks, has anyone else got any input into this... thanks in advance

  6. #6
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    If your queries are all on a single table, combine them. (SELECT email FROM users WHERE (X AND Y) OR (Z AND R) OR (S AND T)). Use your query to filter the results, rather than PHP, as much as possible.
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  7. #7
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok cool, thanks for your help, much appreciated


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •