I am storing last login time of user in users table, I want to get all the users inactive from 10 days anyone help with the query.
Printable View
I am storing last login time of user in users table, I want to get all the users inactive from 10 days anyone help with the query.
Try this:
date in the query above is a column name. You can read more about MySQL time and date functions here.Code:SELECT ID, date, name FROM users WHERE date > CURDATE()-10;