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.
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
Setting data to expire
#1
Posted 27 October 2007 - 04:43 AM
<a href="http://www.jaypan.com" target="_blank">Jaypan</a>
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
#2
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
#3
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.
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
#4
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>
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
#5
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..
just reading through but I've got a good piece of information obtained here..
thanks guys..
Share this topic:
Page 1 of 1


Help
This topic is locked

MultiQuote










