Setting data to expire

Discussion in 'Databases' started by wryfhk22, Apr 20, 2011.

  1. #1
    Is there a way to set up mysql so that a table value changes after a set period of time? The specific situation of which I am speaking is that I have set up a script to send a mail to a user if they request their password to be reset. I want that to reset after 24 hours, and the easiest way I see to do this is to delete the reset code out of the table that it is saved into. If I could set it so that values in that cell expired after that 24 hours it would be nice.
     
    wryfhk22, Apr 20, 2011 IP
  2. SamTech

    SamTech Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello,

    you can not define such auto task in database itself to delete the cell values, instead you can create a script and schedule to to run at any particular time as per your requirement, write the code in script to delete the cell values.
     
    SamTech, Apr 21, 2011 IP