Jump to content

DELETE FROM...


Baseball

Recommended Posts

You would need to store the last time (time()) the query was executed in the database..

Then before running the query do something like this..

$sql = "SELECT last_refresh_time FROM refresh_table WHERE id=ID LIMIT 1";
$sql_query = mysql_query($sql);
$l = mysql_fetch_assoc($sql_query);
if (time() - $l['last_refresh_time'] > 300) {
// run the delete query //
mysql_query("DELETE FROM WHERE Id running_time  > XXX");
// then update the time
mysql_query("UPDATE refresh_table SET last_refresh_time = '".time()."' WHERE id=ID");
}

Link to comment
https://forums.phpfreaks.com/topic/186240-delete-from/#findComment-983573
Share on other sites

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.