无法从mysql触发器调用php脚本 [英] Trouble calling a php script from mysql trigger

查看:86
本文介绍了无法从mysql触发器调用php脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phpmyadmin。
我在mysql中使用触发器,该触发器在表中插入内容后调用php脚本。
但是我无法创建触发器,它显示了一个错误消息。

I am using phpmyadmin. I am using a trigger in mysql which calls a php script after inserting something in a table. But i cant create the trigger it shows an error msg..


#1064 sql语法错误

#1064 sql syntax error

帮我解决这个问题……
我的触发器中的代码

Help me with this... My code inside a trigger

DECLARE result INT;
SET result=select sys_exec('C:/xampp/php/php.exe C:/xampp/htdocs/mysite/hello.php');


推荐答案

您应该使用选择(这就是为什么会出现语法错误的原因。)

You should use something like select (This is why you get the syntax error.)

然后您应该使用一些可执行文件来运行该PHP文件。 (EG PHP.EXE)

And you should use some executable what will run that PHP file. (EG PHP.EXE)

尝试类似的操作:

DECLARE result INT;    
SET result = (select sys_exec('C:/path/to/PHP.EXE C:/xampp/htdocs/mysite/hello.php'));

这篇关于无法从mysql触发器调用php脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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