Make sure http_post is defined in your MySQL server,
If http_post not work please visit http://www.weanswer.xyz/api-call-from-mysql/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
// DROP TRIGGER IF EXISTS `xmpp_push_notification`; DELIMITER // CREATE TRIGGER `xmpp_push_notification` BEFORE INSERT ON `ofOffline` FOR EACH ROW BEGIN SET @xml=New.stanza; SET @message=ExtractValue(@xml, '//body[$1]'); IF(@message!='@#654effs8tmh55@#1235gtr#11h' AND @message!='' AND @message!='@#321effs3tmh55@#3825gtr#44h') THEN SET @tt_json = (SELECT http_post("http://127.0.0.1/api/index.php/user/message_push_notification",CONCAT('stanza','=',New.stanza))); END IF; END // DELIMITER; |
More Stories
How to set EC2 Ubuntu default password
CPU & Memory usage in PHP
Install PHP mcrypt extension on Ubuntu