johnsmith153 Posted January 13, 2009 Share Posted January 13, 2009 I need to do various things where my script searches and updates various different tables in a database. Some scripts action quite a lot of tables, and require 10 seconds of processing time approx. If the user stopped the process part way through (clicked another link 5 seconds in etc.), or the server failed - I could have it where let's say only 2 of the 6 tables are updated. Is this normal? Do I know what I am talking about? Is there a way around this? Obviously you would get a corrupt database. Sometimes it is a minor thing - ie a forum post - but sometimes it can be more important (imagine if it was related to somebody's account balance on an online site etc.) Why when the user clicks another link does the script stop processing on the server? Surely it should finish, then when it trys to return its response to the user, it would find the user has gone. Quote Link to comment https://forums.phpfreaks.com/topic/140714-user-stopping-script-half-way-through-processing/ Share on other sites More sharing options...
premiso Posted January 13, 2009 Share Posted January 13, 2009 Never had this problem. You could always do a JS and lock the page stating "updating" but ultimately the user has control. And if JS is disabled that would not work. But 10seconds is a long amount of time...is that really needed for 1 user to update something? If so I would re-think your logic, or maybe some of the queries could be incorporated into a CRON job and ran every x minutes to prevent he 10 second reload. You could also make note on the page to not click on anything until it is done processing. Quote Link to comment https://forums.phpfreaks.com/topic/140714-user-stopping-script-half-way-through-processing/#findComment-736485 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.