now() and an hour from now()

admin

Administrator
Staff member
I am runing php from the command line as a cron job. I have a email which is sheduled to go out sometime during the day so it is stored as Sendtime in the database (MySQL).

The cron job will run hourly, so I need all the emails that are scheduled for the current hour, but I am now sure how to write the sql statment.

something like:
select * from Mailqueue where (now() + hour(1)) < Sendtime and sent = '0';

this obvioulsy won't work, but I think it explains what I want

thanks
 
Back
Top