-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,820
  • 3
  • 21
  • 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
  • 357
  • 1
  • 5
  • 14
1

Yes, you can call php scripts if you install mysql_udf_sys

N.B.
  • 13,688
  • 3
  • 45
  • 55
0

Tx to this post 1, use :

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