`SI_ID is` the Auto Increment Field
`SI_Reg_No` i the student registration number
`SI_Ins_NO` is the installment number
`SI_Due_Date` is the due date of that installment
`SI_Paid_Amount` is the paid amount of each installment
when my payment form button click i want to update the SI_Paid_Amount field.When i click on the payment field bellow table data is already loaded without SI_Paid_Amount.
$amount = 5000.00 // this is what i send to the db for update `SI_Paid_Amount`
if SI_paid_Amount
should be update like bellow
From first SI_Ins_No
if SI_Ins_amount is bigger than $amount
it should update the Si_Paid_Amount field and it should stop the loop. like bellow
If the SI_Ins_Amount less than sending amount it should be update the 2nd SI_Ins_No related SI_Paid_Amount
column.And also when sending the data to SI_Paid_Amount
we want to check amount previous SI_Paid_Amounts
according to SI_Ins_No
.So my question is how i do this with php ???