Announcement

Collapse
No announcement yet.

Deleting files over 2 weeks old.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tim Mousel
    replied
    $currenttime = time();

    $sql = "DELETE FROM table WHERE expires < $currenttime";

    Leave a comment:


  • Bealers
    replied
    ...........

    Leave a comment:


  • Menno
    replied
    Yeah, that would be a nice disaster

    Leave a comment:


  • Stallion
    replied
    I just hope there aren't any of those "slips" in Back-End! ;-)

    Leave a comment:


  • Mike Sullivan
    replied
    Yes, damn things aren't telapathic

    Leave a comment:


  • Bealers
    replied
    yep <

    NOT >

    pesky keyboard

    Leave a comment:


  • Josh
    replied
    Thanks guys...

    I didn't even think of that method and the only other ones people suggested involved detailed calculations

    Thanks again,

    ~Josh

    Leave a comment:


  • Mike Sullivan
    replied
    I might be wrong, but shouldn't it be:

    where date < some_date

    ??

    Leave a comment:


  • Bealers
    replied
    delete from table where date > some_date

    Leave a comment:


  • Josh
    started a topic Deleting files over 2 weeks old.

    Deleting files over 2 weeks old.

    I'm working on a script that will use a mySQL database to house the information. I have the script written and the database created, but need to find an easy way to remove entries that are over 2 weeks old.

    What would be the easiest way to acheive this?

    Thanks
    ~Josh
Loading...
Working...
X