Invoking a PHP script from a MySQL trigger

前端 未结 10 1918
时光取名叫无心
时光取名叫无心 2020-11-22 07:31

Is there any way how to invoke a PHP page / function when a record is inserted to a MySQL database table? We don\'t have control over the record insertion procedure. Is ther

10条回答
  •  长情又很酷
    2020-11-22 07:59

    I found this:

    http://forums.mysql.com/read.php?99,170973,257815#msg-257815

    DELIMITER $$
    CREATE TRIGGER tg1 AFTER INSERT ON `test`
    FOR EACH ROW
    BEGIN
    \! echo "php /foo.php" >> /tmp/yourlog.txt
    END $$
    DELIMITER ;
    

提交回复
热议问题