Jump to content

ExpireTable Data


phpretard

Recommended Posts

Is there a way to expire table data based on a date.

 

An example would be:

 

I upload information into "field 1"  on 1-1-2008

 

and did not update information in "field 2" by 1-3-2008

 

then the information in field one would be deleted on 1-3-2008.

 

Does this make any sense?

 

 

Link to comment
https://forums.phpfreaks.com/topic/122446-expiretable-data/
Share on other sites

It's very easy.

 

$ crontab -l  #Checks current crons for your user
$ crontab -e #Opens your text editor to edit the crontab.  Format discussed below.  The editor it opens can be set by exporting EDITOR, but I think it defaults to nano

 

The format for a crontab line is:

m h dom mon dow command

 

* can be used to represent "every".  So to run an hourly php script, it would be:

0 * * * * /usr/bin/php -f test.php

 

You could probably just use php as the command, but you'll want to make sure it's in your path.  Run:

$ which php
$ echo $PATH

And verify that the folder that PHP is in is inside your PATH, but /usr/bin should always be unless you removed it yourself.

 

Phew, that was annoying to type.

Link to comment
https://forums.phpfreaks.com/topic/122446-expiretable-data/#findComment-632288
Share on other sites

I don't know about Florida, but in UK, the word retard is frowned upon as an antiquated insult. In reality, in physics it means to slow down, apply a brake, and the statement 'php slow down' doesn't make sense.

 

Also you changed my expression of the word to you yourself, which as Dirk Benedict (Face from A-Team) has just described as being 'passive aggressive', lol.

Don't ya love grammar!

 

 

* Just seen your post *

pretard

So what does the 'ph' stand for?

 

Link to comment
https://forums.phpfreaks.com/topic/122446-expiretable-data/#findComment-632298
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.