stephend330 Posted December 6, 2010 Share Posted December 6, 2010 hi im not sure if this is a MySQL, PHP or other problem what im trying to achive is user clicks button -> after a time delay of days or hours -> update database with new data im trying to build a leveling up system thanks Quote Link to comment https://forums.phpfreaks.com/topic/220830-update-after-a-time-delay/ Share on other sites More sharing options...
shlumph Posted December 6, 2010 Share Posted December 6, 2010 Perhaps updating the database right away, and then caching the results for the user for a certain period of time would be a solution. Otherwise you'd probably have to store everything in a temporary directory, and then set up a cron job to scan the folder and make the DB updates. Quote Link to comment https://forums.phpfreaks.com/topic/220830-update-after-a-time-delay/#findComment-1143598 Share on other sites More sharing options...
stephend330 Posted December 6, 2010 Author Share Posted December 6, 2010 do you know of any tutorial i could refur to complete this task Quote Link to comment https://forums.phpfreaks.com/topic/220830-update-after-a-time-delay/#findComment-1143600 Share on other sites More sharing options...
Spring Posted December 6, 2010 Share Posted December 6, 2010 Perhaps updating the database right away, and then caching the results for the user for a certain period of time would be a solution. Otherwise you'd probably have to store everything in a temporary directory, and then set up a cron job to scan the folder and make the DB updates. I have the same question, but I was pretty sure you could some how use a php time function to do this..or maybe javascript? Is going through all that trouble the only way? Quote Link to comment https://forums.phpfreaks.com/topic/220830-update-after-a-time-delay/#findComment-1143602 Share on other sites More sharing options...
stephend330 Posted December 6, 2010 Author Share Posted December 6, 2010 yer i was thinking of using javascript but do not know if you can Quote Link to comment https://forums.phpfreaks.com/topic/220830-update-after-a-time-delay/#findComment-1143625 Share on other sites More sharing options...
shlumph Posted December 6, 2010 Share Posted December 6, 2010 JavaScript happens on the users machine, and if you want to delay a function call for hours, or even days, chances are the person will close their browser by then Quote Link to comment https://forums.phpfreaks.com/topic/220830-update-after-a-time-delay/#findComment-1143680 Share on other sites More sharing options...
Spring Posted December 7, 2010 Share Posted December 7, 2010 I fixed mine by using sessions. session_start(); session_set_cookie_params(84600); if(isset($_POST['submit'])){ $_SESSION['clicked'] = 1; } You should know what to do from here. (: Quote Link to comment https://forums.phpfreaks.com/topic/220830-update-after-a-time-delay/#findComment-1143862 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.