Question

is there any way to send SMS on mysql database data change in PHP?im using twillo as SMS gateway.

Was it helpful?

Solution

If you have control over the PHP code that handles the changes over mysql, you can write your trigger in that code itself, If you only have access the MySQL db not the code that writes to it, you should create a trigger for that particular table, and on change, write some row to another table.

This way you can write a different PHP script that checks the other table in a cronjob for example, and send you an SMS, If some new rows inserted to that table, using Twilio API or another SMS gateway since they do not matter.

See MySQL Trigger Documentation for more information

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top