Jump to content

Entry disappearing after a specific time


cordoprod

Recommended Posts

explaining something like this is quite complicated.... why cant you use mysql instead?

 

----

anyway im guessing you know how to find,edit and delete entries from your flat file, so you want to know how to compare a date to check how old it is?

 

first off, save a date_added field with a time(); unix timestamp. check this field like so:

 

if(time() >= ($db_date_added + 2592000)){
  // delete entry
}

 

this will delete the record after 30 days.

 

--------

also see http://www.php.net/date for more information on the php's date functionality

 

 

hope this helps,

do you mean when you read it?

 

have a look at php.net/date and choose, i usually go for : date("jS F y");

 

if saving to a db you should ALWAYS use time(); as a unix timestamp, you can use date("jS F y",time()); to format timestamps.

hope this helps,

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.