1

I am making a script to trigger a message according to the record recorded in the database. It's like a CRON task.

I have the following record enter image description here

I'm going to put a PHP page in the CRON task of Cpanel, but how can I make a query that checks every minute if the record is on the time and day to be fired?

In this image example, you should return the record when: 9 hours 5 minutes Monday, Tuesday or Thursday

See what month and day is with *

SELECT * 
FROM  `schedule` 
WHERE 1 =1
AND (
(
dia = DAY( NOW( ) )
)
OR (hora = DAY( NOW( ))    
)

How could I check the asterisk and not get into the conditions, I will use OR operator will it work?

Sean Lange
  • 30,535
  • 3
  • 21
  • 37
Will
  • 211
  • 1
  • 2
  • 14
  • Take a look at [Event Scheduler](https://dev.mysql.com/doc/refman/5.7/en/event-scheduler.html) – Harisudhan. A Jun 22 '17 at 13:45
  • Let's say I create an Event Scheduler, how do I call my PHP page to trigger the email I scheduled? – Will Jun 22 '17 at 13:52
  • it was already discussed for many times [refer here](https://stackoverflow.com/questions/10097609/how-to-run-php-file-using-cron-jobs) – Harisudhan. A Jun 23 '17 at 05:49

0 Answers0