-1

I have written a trigger, but mysql doesn't like it:

Code :

create trigger triggers_on_comand_line AFTER UPDATE on test1 
for each row 
begin 
IF total_volume >= used_volume
THEN
\! echo "php -f /home/test.php" 
END; 

I got this error :

** MySQL said: Documentation 1064 - 064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '! echo "php -f /home/test.php" at line 6 **

Thanks

Rjaibi Mejdi
  • 6,480
  • 3
  • 19
  • 26

3 Answers3

1

You are writing in MYSQL language, and execute in query language, but the line "system php -f /home/test.php" is written in PHP language.

cat
  • 327
  • 1
  • 5
  • 14
1

Yes, you can call php scripts if you install mysql_udf_sys

N.B.
  • 13,116
  • 3
  • 42
  • 52
0

Tx to this post 1, use :

\! echo "php -f /home/test.php"
Guilhem Hoffmann
  • 944
  • 5
  • 13