Hello:
I could use some help with updating a table which contains multiple rows for each program/lender combo. At any given time, one can add a new lender or program. So, the script should also be able to insert new lenders/programs if they don't exist in the table otherwise update the ones that do.
There are four rates and prices for each program/lender combination.
My table "rates" has the following fields: id, lender_id, program_id, rate, price, date, time.
The first script I have is admin_update_rate.php. This script selects the program and lender you want to update/insert and asks for a starting rate.
The script then calls for admin_update_rate_1.php which a.) increments the starting rate by .125 and b.) displays the form with the incremented rates showing and the price fields blank.
When the prices are entered, this script calls for admin_update_rate.php. This script does a.) displays the rates and prices entered for verification and b.) redisplays the input form in case a typo occurred. If a typo happened, the correct value is entered and submitted. The report updates with the new changes.
And, here is where I'm stuck. Once the changes are made and verified, I would like my table to be updated with the new rates and prices for the lender/program originally selected.
At the bottom of the script, I'm calling for admin_update_rate_3.php which should perform the actual update. Though, if I can do it within admin_update_rate_2.php that would be great as well.
I hope someone can help me out here. I attached all three scripts as text files to this post for reference.
Thank you for all the help.