#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    5
    Rep Power
    0
    Can make a table that some how entries will expire and do something or maybe just delete themselves after a certain perdiod of time or at a certain date?
    Is there a data type for that?

    thanks,
    mike
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Hi,

    You can't set expiry date in the table.

    You should write a program that should delete the values of a particular period.

    eg: "DELETE FROM tablename WHERE TO_DAYS(NOW())-TO_DAYS($date_field)=60";


    And above script should work frequently in your server.


    Perhaps you may use "cron job" for performing
    frequent action in the server...




  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    4
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Mikeage:
    Can make a table that some how entries will expire and do something or maybe just delete themselves after a certain perdiod of time or at a certain date?
    Is there a data type for that?

    thanks,
    mike
    [/quote]

    Mike,

    I saw this somewhere.
    You need an entrydate int, and expiredate int, in your table and then sth like this included in a function ExpireThings()

    $today = Date("Ymd");
    $sql = "DELETE FROM things WHERE expiredate<$today";

    Brian

Similar Threads

  1. Controlling Multiple table Heights in a Browser
    By AttaBoy in forum HTML Programming
    Replies: 1
    Last Post: December 10th, 2003, 04:24 AM
  2. Soccer League table
    By silverduck in forum Database Management
    Replies: 3
    Last Post: August 19th, 2003, 04:46 AM
  3. Create form to edit mysql table entries
    By Namaseit in forum PHP Development
    Replies: 1
    Last Post: July 24th, 2003, 02:21 PM
  4. help on 3 table join query?
    By smakz in forum Database Management
    Replies: 1
    Last Post: November 19th, 2002, 04:00 AM
  5. looking in a table for repeated entries
    By davaby in forum MySQL Help
    Replies: 9
    Last Post: August 22nd, 2002, 10:47 AM

IMN logo majestic logo threadwatch logo seochat tools logo