douhuang5623 2017-11-11 20:23
浏览 636
已采纳

MySQL到期日前一个月的提醒通知(6个月)

I have found similar answers but I didn't find exact one, so I am starting a new question.

I have a little app for a mechanic shop, where the user can input information about the car, such as registration number, a name of the owner, date when the car was on service ( an auto added/updated field in MySQL).

My question is since all cars must do a service inspection again in 6 months, how can I after 5 months print out information that in next 30 days XY cars needs to make a new inspection?

EDIT:

*SELECT * FROM vozila where DATE_ADD(DATE(datum), INTERVAL 6 MONTH) = CURDATE()*

In case above, it is displaying only 5-month-old serviced cars from current date, but I need to set it to display notification 5 months after, and that that results stay on page for next 30 days (untill month 6th).

Let's say that some XY car was on the mechanic service at 1.1.2017... At 1.6.2017 on notification.php page there would be "Cars with expiration date in next 1 month:" table and on it would be all cars that are 1 month left up to 6th when then need to do it again.

  • 写回答

1条回答 默认 最新

  • dongli1920 2017-11-11 21:38
    关注

    "SELECT * FROM vozila where datum < date_sub(now(), interval 11 month)"

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥15 绘制多分类任务的roc曲线时只画出了一类的roc,其它的auc显示为nan
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?