有什么方法可以从MySQL执行PHP脚本吗? [英] Is there any way I can execute a PHP script from MySQL?

查看:179
本文介绍了有什么方法可以从MySQL执行PHP脚本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从MySQL过程调用并执行PHP脚本.这可能吗?

I want to invoke and execute a PHP script from a MySQL procedure. Is this possible?

CREATE PROCEDURE simpleproc (OUT param1 INT)
    BEGIN
         Call my php script here
    END//


实际上,我正在尝试在满足条件时引发一个事件,例如,当我的表字段值与当前时间匹配时.然后,我想捕获事件并发送电子邮件.


I am in fact trying to raise an event when a condition is met — for instance when my table field value matches the current time. Then, I want to capture the event and send an email.

推荐答案

有可能,有关详细说明,请参见MySQL FAQ.

It's possible, See the MySQL FAQ for an explanation of how

可以通过以下方式触发调用外部应用程序UDF?

但是,如果您不得不诉诸于此,那对您来说可能是不好的设计

But it's likely to be bad design on your part if you have to resort to this

这篇关于有什么方法可以从MySQL执行PHP脚本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆