0

Actually i have implemented something by which i am getting data from some outside source into my database table, and now want to add some trigger at insert time, that will fire my Php page code , that php code is having some logic that fires SMS. So as soon as i got data into my sql table i want to fire / execute my php page to send sms autometically. But I don't know how to use sql to execute a url or php page. Please help in this matter.

I am thinking like , When data will inserted by some third party into my db table , then trigger will run some stored procedure , that stored procedure will execute a php page and then automatically my task will done.

Select php-url from lead_table where id=5 EXEC php-url END-EXEC

2
  • Possible duplicate of MySQL Trigger on after insert Commented Oct 15, 2019 at 17:12
  • 2
    Better approach: use php to get the data, update database, and send sms. How are you getting data into you database? Commented Oct 16, 2019 at 1:04

1 Answer 1

1

Using api I was receiving the data from third party like this insert_new.php?name=vibhor&add=abc etc. Then i was inserting into the data base table. My thinking was wrong to execute php page from sql table. Actually my code was creating the sql row, so i used the same variables that i was passing in insert query and then i pass those variable to other send sms php page using curl. And hence I am able to send the sms instantly and automatically... This solved my problem. I edited my code in insert_new.php and everything works great :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.