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条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?