AKalair Posted March 6, 2010 Share Posted March 6, 2010 Hi guys, It is possible to trigger an event at a certain time in PHP and MYSQL ? For example I have a database of events and as each one occurs I want it to tweet out a message to Twitter So it is possible to do something like: if (time == timeofevent): Send message Thanks Link to comment https://forums.phpfreaks.com/topic/194376-how-to-trigger-an-event-at-a-certain-time/ Share on other sites More sharing options...
Mchl Posted March 6, 2010 Share Posted March 6, 2010 Google 'cron' Link to comment https://forums.phpfreaks.com/topic/194376-how-to-trigger-an-event-at-a-certain-time/#findComment-1022489 Share on other sites More sharing options...
AKalair Posted March 9, 2010 Author Share Posted March 9, 2010 Hi, Thanks for the reply Is there no way to do this in the language ? How do things like Google Calander pop up alerts for events ? Thanks Link to comment https://forums.phpfreaks.com/topic/194376-how-to-trigger-an-event-at-a-certain-time/#findComment-1023599 Share on other sites More sharing options...
trq Posted March 9, 2010 Share Posted March 9, 2010 PHP isn't a service. It only comes to life when a web server gets a request that needs to be parsed by it. Cron is the periodic scheduler used on Linux. Link to comment https://forums.phpfreaks.com/topic/194376-how-to-trigger-an-event-at-a-certain-time/#findComment-1023610 Share on other sites More sharing options...
Mchl Posted March 9, 2010 Share Posted March 9, 2010 How do things like Google Calander pop up alerts for events ? They run JavaScript script in the browser that periodically polls server for updates. Link to comment https://forums.phpfreaks.com/topic/194376-how-to-trigger-an-event-at-a-certain-time/#findComment-1023632 Share on other sites More sharing options...
trq Posted March 9, 2010 Share Posted March 9, 2010 How do things like Google Calander pop up alerts for events ? They run JavaScript script in the browser that periodically polls server for updates. I would also assume they run some sort of scheduler every minutes or so and check dates & times and send notifications. Link to comment https://forums.phpfreaks.com/topic/194376-how-to-trigger-an-event-at-a-certain-time/#findComment-1023839 Share on other sites More sharing options...
Mchl Posted March 10, 2010 Share Posted March 10, 2010 For email notifications for sure. For (in-browser) popups not necessarily. Link to comment https://forums.phpfreaks.com/topic/194376-how-to-trigger-an-event-at-a-certain-time/#findComment-1024247 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.