Trouble calling a php script from mysql trigger

情到浓时终转凉″ 提交于 2019-12-26 03:16:12

问题


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 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');

回答1:


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

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

Try something like:

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


来源:https://stackoverflow.com/questions/24432115/trouble-calling-a-php-script-from-mysql-trigger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!