Trouble calling a php script from mysql trigger

2019-09-19 16:09发布

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条回答
冷血范
2楼-- · 2019-09-19 16:56

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'));
查看更多
登录 后发表回答