Jump to content

delete mysql rows 3 days old


The Little Guy

Recommended Posts

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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.