Using PHP, I have a query that goes through my DB looking for pending tasks with reminder triggers at certain times of the day. I have a cronjob that runs every 10 mins and chec
How often do you want to send an email? If it's on occurence (the minute it is discovered by your existing cronjob, i.e. every 10 minutes), you could make the script that looks for the remind-me flag do this:
1 - add a reference to each row the flag was found in to an array, e.g.
$reminders = array(1, 3, 212);
Each element in the array references a primary key of your tasks table, here I used "tasks".
2 - after the database lookup is complete, see if $reminders is not empty and then run a query like
$query = "SELECT * FROM tasks WHERE id = '".implode(',', $reminders)."'";
to get all the task-specific data
3 - send an email to youself with this data using mail.
Was this what you were looking for?