MySQL trigger which opens some URL?

Discussion in 'MySQL' started by ivo.pavlik, Aug 5, 2009.

  1. #1
    Hello.

    Is it possible to open an URL, or run PHP script with some MySQL trigger. E.g. when some new data appear, run a PHP script which sends some newsletter or other mail.

    Thanks.
     
    ivo.pavlik, Aug 5, 2009 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    No. Best bet would be to make a script to look for a certain change in the database. Use a cron every few minutes to check for it and execute the email or whatever other function you need.

    You could use a trigger to update a temporary table which could make the query much faster. Have the script look in the temp table, send the email, and then delete the row from the temp table to prevent sending duplicates.
     
    jestep, Aug 6, 2009 IP
  3. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Or you could just build your PHP script to look for it.. after you do your query you check the $_POST array for whatever it is that you're checking and do it then? Not something that should be done at the SQL level I'm afraid.
     
    premiumscripts, Aug 6, 2009 IP