Jump to content

Setting data to expire

Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Setting data to expire Rate Topic: -----

#1 User is offline   haku 

  • 日本語 Ninja
  • Group: Members
  • Posts: 652
  • Joined: 21-September 07
  • Gender:Male
  • Location:Yokohama, Japan

Posted 27 October 2007 - 04:43 AM

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.
<a href="http://www.jaypan.com" target="_blank">Jaypan</a>
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
0

#2 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

Posted 27 October 2007 - 07:03 AM

What you are asking would put application logic into your database. This isn't necessarily the best thing to do - your application logic should really be in your application and your database should just store your data. The standard way to do this would be to have an additional column containing an expiration date, and have your application check the date when the user next visits the website.
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
0

#3 User is offline   Telos 

  • Eternal Being
  • Group: Members
  • Posts: 250
  • Joined: 08-May 07
  • Gender:Male
  • Location:Finland

Posted 27 October 2007 - 02:11 PM

Scheduled tasks.

Make a script which checks the conditions for example once per hour and reset the password if it has been 24h when it was asked to be reseted.
I am a man without a website
0

#4 User is offline   haku 

  • 日本語 Ninja
  • Group: Members
  • Posts: 652
  • Joined: 21-September 07
  • Gender:Male
  • Location:Yokohama, Japan

Posted 27 October 2007 - 03:13 PM

Thanks guys. I'll work on one of those. I appreciate the help.
<a href="http://www.jaypan.com" target="_blank">Jaypan</a>
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
0

#5 User is offline   EncoderDecoder 

  • W.R. Sergeant
  • Group: Members
  • Posts: 260
  • Joined: 01-March 11
  • Gender:Female
  • Location:Philippines

Posted 15 April 2011 - 08:56 AM

oh, i see..

just reading through but I've got a good piece of information obtained here..

thanks guys..

:)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users