alexandervj Posted March 2, 2015 Share Posted March 2, 2015 Hi, I have a MySQL database filled with data from product sheet requests. On our website we have a modal that allows users to request our product sheets. The requests get sent to the database, and also emailed to the group who are responsible for responding to the requests. I would like to set up a cron job to run a php script that connects to the database, then checks to see if a request is older that 24 hours, if it has been marked as 'responded to', - if it is older than 24 hours and not marked as 'responded to' then I want it to send an email reminder to the group that is responsible for responding to the requests. I've been using CodeIgniter so I'm a little rusty on plain PHP and I'm not sure how to go about this. Any help you can give is much appreciated! Link to comment https://forums.phpfreaks.com/topic/295022-trying-to-create-a-cron-job-that-will-send-an-email-if-a-value-in-the-database-meets-certain-criteria/ Share on other sites More sharing options...
ginerjm Posted March 2, 2015 Share Posted March 2, 2015 What have you tried so far? Break your problem down to separate parts - first the query to find the desired data, then the script to do all the work and finally (once debugged) create the cron setup for your script. So - show us the code to interrogate your db. Link to comment https://forums.phpfreaks.com/topic/295022-trying-to-create-a-cron-job-that-will-send-an-email-if-a-value-in-the-database-meets-certain-criteria/#findComment-1507279 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.