1

I want to call a Php function using the MYsqli trigger and I have found that this has a lot of security threat. I want to send an sms daily at certain time to all those in my database who's license expiry is within 7 days so what should be my approach to this?

Sandeep
  • 155
  • 1
  • 14

1 Answers1

0

Easy to do by cron .its my suggestion

This is the best explanation with code in PHP I have found so far:reference

cron.php

        <?php

          echo "hiiii";
          Do ur stuff here ....
        ?>

You can edit the crontab usually (not always the case) by entering crontab -e in a ssh session on the server.

        every minute 

        */1 * * * * php /var/www/path/to/cron.php

Above code execute the cron.php every seconds once.customize by your need

The stars represent (* means every of this unit):

        [Minute] [Hour] [Day] [Month] [Day of week (0 =sunday to 6 =saturday)] [Command]
JYoThI
  • 11,977
  • 1
  • 11
  • 26
  • I am currently running my php and mysql in my windows system(Localhost) can this be done in windows also? – Sandeep Jun 13 '16 at 06:35
  • try this http://stackoverflow.com/questions/9894804/use-php-to-set-cron-jobs-in-windows – JYoThI Jun 13 '16 at 06:44
  • Thanks jothi http://stackoverflow.com/questions/9894804/use-php-to-set-cron-jobs-in-windows this worked – Sandeep Jun 13 '16 at 10:23