Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/168668-mysqlphp-newbie-simple-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.