Jump to content

MySQL/PHP newbie - Simple problem


Alanmelon

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.