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. Quote Link to comment 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] Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted November 26, 2006 Author Share Posted November 26, 2006 Nevermind... I got it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.