tekrscom Posted August 17, 2009 Share Posted August 17, 2009 PHP version 5.2.5 MySQL version 5.0.81-community-log Hi, I'm wanting to create a script to run clean up on my members, to delete members that have not validated their email and it has been greater than 3 days since they created their account... Here is what I have, but it is giving results that are within the 3 days... $query = "SELECT UserID FROM Users WHERE EmailValidated = 'No' AND (StartDate > DATE_ADD(CURDATE(), INTERVAL -3 DAY))"; Can someone please help? Link to comment https://forums.phpfreaks.com/topic/170717-solved-mysql-date-date_addcurdate-interval-3-day/ Share on other sites More sharing options...
tekrscom Posted August 17, 2009 Author Share Posted August 17, 2009 Whoops... I found the obvious problem... should be < not > $query = "SELECT UserID FROM Users WHERE EmailValidated = 'No' AND (StartDate < DATE_ADD(CURDATE(), INTERVAL -3 DAY))"; Link to comment https://forums.phpfreaks.com/topic/170717-solved-mysql-date-date_addcurdate-interval-3-day/#findComment-900401 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.