发布日期可用性和架构
我有一个处理事件的应用程序。事件发生后,我需要向我的用户发送电子邮件并询问他们有关事件的信息,并允许上传照片等。
我的问题是 除了运行一些 unix cronjob 之外,我的系统自动检测其“事件后”时间的最佳方法是什么?
我使用 MySQL - 是否可以在 PHP 或 MySQL 中设置一些触发器?
网站通常如何做到这一点?
谢谢, 亚历克斯
I have an application that deals with events. After an event has occurred, I need to email my users and ask them about the event, and allow to upload photos, etc.
My question is
Whats the best way for my system to automatically detect that its "post event" time other than running some unix cronjob?
I use MySQL - is there some trigger that I can set, either in PHP or MySQL?
How do sites usually do this?
Thanks,
Alex
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
cronjob/计划任务上的 php 脚本是最简单的方法。
我想您可以将检查作为网站脚本的一部分,或者在任何用户访问该网站时进行检查。您需要存储它上次检查的时间,并检查从那时到现在发生的事件并通过电子邮件发送给它们,并检查上次检查的时间以确定是否应该再次查看,这样您就不会让它运行每次用户访问该页面时。
A php script on a cronjob/scheduled task is the easiest, simplest way to do so.
I suppose you could make the check a part of the scripting for the site or something that checks when any user accesses the site. You'd want to store the last time it checked and check for events that occurred between then and now and email for them, and also check the last time it checked to determine if it should look again, so you don't have it running every time a user accesses the page.
是的,它是 mysql 内置的 事件调度程序,但是我不知道这对您有什么帮助,因为用它发送电子邮件会非常棘手。
Yes, it is the event scheduler built-in mysql, but I have no idea how this can help you, since it will be very tricky to send emails from it.