lastlogin is getting saved as time() in my mysql table and it is varchar mode.
querying the database to send out emails to remind my users that they have not logged in from past 30 days
SELECT * FROM members WHERE lastlogin = DATE_SUB(CURDATE(), INTERVAL 30 DAY)
i tried with several options, but not able to query exactly as i need. for example,
SELECT * FROM members WHERE lastlogin < DATE_SUB(CURDATE(), INTERVAL 30 DAY)
SELECT * FROM members WHERE lastlogin < DATE_ADD(CURDATE(), INTERVAL 30 DAY)
can some one help me on this to achieve this function please.