needs_upgrade Posted August 11, 2012 Share Posted August 11, 2012 Hello guys! My system cannot handle internet disconnections well. For example if a user will enter a customer?s payment, the system should do several functions like: 1. Add the payment entry to the payments table, 2. Subtract the payment from the accounts receivables, 3. Update the balance of the company?s bank account 4. Add the payment entry to the bank-trail table But what if upon pressing the submit button, there has been an internet connection. There are instances where only functions 1 and 2 were finished. How can the system undo the inserts/updates made by functions 1 and 2 if functions 3 and 4 were not executed? - so that the user can repeat the process. Thanks for your insights in advance Quote Link to comment https://forums.phpfreaks.com/topic/266939-handling-internet-disconnections/ Share on other sites More sharing options...
Christian F. Posted August 11, 2012 Share Posted August 11, 2012 What you need are database transactions, which are very easy to implement. I recommend reading up on them, and this article seems to be quite adequate. Quote Link to comment https://forums.phpfreaks.com/topic/266939-handling-internet-disconnections/#findComment-1368566 Share on other sites More sharing options...
needs_upgrade Posted August 13, 2012 Author Share Posted August 13, 2012 Thanks Christian. Quote Link to comment https://forums.phpfreaks.com/topic/266939-handling-internet-disconnections/#findComment-1368885 Share on other sites More sharing options...
Christian F. Posted August 13, 2012 Share Posted August 13, 2012 You're welcome. Quote Link to comment https://forums.phpfreaks.com/topic/266939-handling-internet-disconnections/#findComment-1368990 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.