The Little Guy Posted November 25, 2006 Share Posted November 25, 2006 I need to delete rows from a database if the activation code has not been saved, and is over 3 days old.If the activation code has been saved, then ignore it, and don't delete it. Link to comment https://forums.phpfreaks.com/topic/28456-delete-mysql-rows-3-days-old/ Share on other sites More sharing options...
paul2463 Posted November 25, 2006 Share Posted November 25, 2006 First off ASSUMPTION:The date they joined was set up in the database and it is as a normal sql date ( 25-11-2006)[code]$today = strtotime("Now");$3day = strtotime("- 3 day" , $today);$deletedate = date("Y-m-d", $3day);$query = "DELETE FROM (table) WHERE activation is (NOT active) AND date < '$deletedate'";mysql_query($query) or die ('Error in query: $query. ' . mysql_error()); [/code] Link to comment https://forums.phpfreaks.com/topic/28456-delete-mysql-rows-3-days-old/#findComment-130216 Share on other sites More sharing options...
The Little Guy Posted November 26, 2006 Author Share Posted November 26, 2006 what does [b](NOT active)[/b] mean? Link to comment https://forums.phpfreaks.com/topic/28456-delete-mysql-rows-3-days-old/#findComment-130361 Share on other sites More sharing options...
The Little Guy Posted November 26, 2006 Author Share Posted November 26, 2006 Nevermind... I got it. Link to comment https://forums.phpfreaks.com/topic/28456-delete-mysql-rows-3-days-old/#findComment-130362 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.