PHP Select from MySQL where date field is 7 days in the future

后端 未结 6 1566
无人及你
无人及你 2021-01-28 12:30

I have an automatic checker that checks for domains that are going to expire within the next 7 days and it sends and email to the customer.

Im using this SQL Query:

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-28 13:01

    This should give the result as you need:

    DATE_SUB(CURDATE(),INTERVAL 7 DAY) = expiry_date;
    

    You can refer to the link below for more details:

    http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html

提交回复
热议问题