Announcement

Collapse
No announcement yet.

Deleting files over 2 weeks old.

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

  • 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
    Josh
    [email protected]

  • #2
    delete from table where date > some_date

    Comment


    • #3
      I might be wrong, but shouldn't it be:

      where date < some_date

      ??

      Comment


      • #4
        Thanks guys...

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

        Thanks again,

        ~Josh
        Josh
        [email protected]

        Comment


        • #5
          yep <

          NOT >

          pesky keyboard

          Comment


          • #6
            Yes, damn things aren't telapathic

            Comment


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

              Comment


              • #8
                Yeah, that would be a nice disaster
                - Insert viable disclaimer here -

                ArtBeast!

                Comment


                • #9
                  ...........

                  Comment


                  • #10
                    $currenttime = time();

                    $sql = "DELETE FROM table WHERE expires < $currenttime";
                    Five Star Review Script - Add reviews to your website!
                    Mixed Martial Arts - Houston MMA Training
                    Women's Self-Defense - Courses and DVDs available

                    Comment

                    Loading...
                    Working...
                    X