SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MYSQL + PHP. Send out an email when a date (in MySql) has passed.

    Ok.

    I have made a vacation request system with MySql and PHP. I am adding various information into the database, including vacation start and vacation end. Upon submission of the request an email gets send out, and upon approval of the request by their manager another email gets sent out.

    My boss wants an email automatically sent to HR when the vacation end date has passed. Im not quite sure how to tackle this? Is my only option adding something to crontab, or is there some sort of MySQL trigger available?

    Thanks for any help.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do this soft of thing all the time with a PHP script executed as a cron. There's nothing that I know of built right into mysql, so a cron that queries it is definitely the way to go.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes crontab is your friend :> (if you're running a unix like system)

    Code:
    * * * * * wget -q -O /dev/null http://domain/script.php
    this will 'execute' every minute the php script


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
  •