mysql和30天 [英] mysql and 30 days

查看:137
本文介绍了mysql和30天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个网站处理免费订阅,我现在想现在如何取消订阅30天的不活动,我知道这必须用cron-jobs完成,但我不知道如何在用户最后一次登录后计数30?

i'm working on a site that handles free subscriptions and i will like to now how to cancel their subscriptions after 30 days inactivity, i know that this has to be done with cron-jobs but i have no idea on how to count 30 after the last time the user logged in?

推荐答案

SELECT user_id FROM users WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) > last_logged_in_date

这篇关于mysql和30天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆