0
Galley,
I’m making a script to trigger a message according to the record recorded in the database. It’s like a CRON task.
I will 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 time and day to be fired?
In this example of the image, you should return the record when: 9 hours 5 minute Monday, Tuesday or Thursday-made
See what month and day you are with *
SELECT *
FROM `agendamento`
WHERE 1 =1
AND (mes = MONTH(NOW() ))
As I could check the asterisk and not enter the conditions, I will use OR operator will it work?
Do you want when in the record you have * (asterisk) in the month, it does not search? != '*'
– Ademílson F. Tonato
Not only is this more complex as you need to check all fields. Minute, hour, day, week, month
– William
Yes, then you should have one (AND) on the Where for each condition, one for minute, hour, day, week, ....
– Ademílson F. Tonato
Example: If you are asterisk in the week field it means you must perform every day of the week, If you have Masterism in the MES field, it means you have to perform every month. If you are 1,3,5 in the DIA field it means that you should only perform on Monday, Wednesday and Friday
– William