I'm sending alerts out when a scheduled job has ended. I'm selecting records where end date and time equal NOW(). The script runs every minute via cronjob.
WHERE TIMESTAMP(end_date, end_time) = NOW()
The alerts are not being sent out because the cronjob is running every minute and I'm selecting records based on NOW(), which is to the second. So it's almost impossible that the script is run at the same time a job ends.
Is there anyway I can select records which have an end time within the current minute which the cronjob runs? I want to make sure I'm catching these jobs as soon as they end.