Jump to content

Trying to create a cron job that will send an email if a value in the database meets certain criteria


Recommended Posts

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!

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.