问题
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