I have a program which makes changes to an MSSQL database. I wanted some actions to happen when these changes are made, like sending an e-mail. This program doesn't do any of those things and I also can't modify the program, so as my question says.. can I use PHP to keep checking for changes in the database and do those actions? I was thinking something like:
$originalDBContent = "SELECT events FROM evTable";
while(true){
$checkContent = "SELECT events FROM evTable";
while($originalDBContent == $checkContent) sleep(1);
//command below if changes made to db
mail(...);
}
Will it work or any other programs suggested to accomplish this?