dpjr86761 2015-07-11 05:36
浏览 7
已采纳

如果记录的状态在24小时后没有改变,需要向用户组发送短信和电子邮件吗?

I am using php and Mysql. I have a record in my database and i want to check status value of the record after 24hrs of its insertion if it is still in pending or no changed i want to send an SMS and an Email to some person relevant to the status. To achieve this i have implemented a solution in which i used a php code but it need to continuously execute and check status of record that may cause DoS. In Another solution i create a trigger but i can't able to send db values as parameter to the php file. so what should be its solution????

  • 写回答

2条回答 默认 最新

  • dongmubei7950 2015-07-11 05:55
    关注

    Two ways came into my mind for this.

    First, (the good way) using cronjob. It's a really good way.

    Second, (bad way for your purpose) Check to see which rows has age of 30 days in each request coming to website. There are cons for this way as the website doesn't get visitors for some days then SMS or Emails won't be sent on time. Another bad thing is it executes on every request so loading time and memory will be consumed during this process.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?