I want to call my PHP file from Database whenever a new row inserting into table..For that i like to go with TRIGGER concept...To call a PHP file we need a UDF sys_exec()..Could anyone explain me the procedure of installing this UDF in my DB...I am using macintosh,PHPStorm...
Also i am going to place this PHP file in my webserver..In sys_exec() method format is like this...
sys_exec('C:/php/php.exe C:/path/to/script.php');
Can i use this same procedure for calling a PHP file which is placed in webserver???Because PHP.exe file will not be there...If not possbile how could i call the PHP file whenever new row getting inserted into table..
IMHO it is not good decision. In our projects with php and mysql we use triggers and all other actions which should to react on new records, we hang to shedule with checking. It is simple and reliable chain of different systems and easily to search bugs.
Many ways to do this, but calling sys_exec (or any other system commands) it probably the worst way to do it. Just go by Solo.dmitry's answer, or look into using the 'AT' command on the server to run the php file or a regular basis which returns new rows.