Alanmelon Posted August 3, 2009 Share Posted August 3, 2009 Hi, I'm slowly getting to grips with MySQL (5.1.30) and php (5.2.8 ), but need some help with what I believe to be a simple problem. I've been using some software to auto generate the code for a sales system based on two tables. Table one is called sales and contains fields with a breakdown of a sale, total price, amount paid and outstanding balance. Table two is connected under table one under a master:detail relationship and will record the specifics of each payment to the account/sale, thus allowing multiple payment entries for each sale. What I want to work out is a snippet of php code which will run following the addition of a new entry to table two which will add the contents of the 'payment' field in table two to the 'amount paid' field in the corresponding master entry of table one. This is then set up to recalculate the balance remaining. I hope that makes sense! Any help would be gratefully received! Quote Link to comment https://forums.phpfreaks.com/topic/168668-mysqlphp-newbie-simple-problem/ Share on other sites More sharing options...
fenway Posted August 3, 2009 Share Posted August 3, 2009 What do you have so far? Quote Link to comment https://forums.phpfreaks.com/topic/168668-mysqlphp-newbie-simple-problem/#findComment-889987 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.