Hello:
Thank you for the reply. I do believe I have my tables defined.
I was basically going to use two tables.
The first table is the mortgage_type lookup table. It would look like this:
id | type
1 | 30 Year
2 | 15 Year
3 | 5/1 ARM
The second table would be the rates table which will have the data inserted from the data entry form. The table would look like this (each mortgage type will have 10 entries):
id | mortgage_type_id | rate | price
1 | 1 | 6.0 | 0.00
2 | 1 | 6.125 | 0.025
3 | 2 | 5.5 | 0.0
4 | 3 | 4.25 | 0.025
etc....
Then, if I want to see all the rates and prices for a 30 Year, I would write my select like this:
SELECT rate a, price a, type b
FROM rates a, mortgage_type b
WHERE b.mortgage_type = a.mortgage_type_id;
I should get a result like this:
30 Year | 6.0 | 0.00
30 Year | 6.125 | 0.025
Am I on the right track with the database portion?
Now, I need to design my form so I can get the data from the form into the table. I'm not sure if I'm following you. Here's what I think you are suggesting.
If I have 10 input boxes for the rates, then each input box would have a name = rate[]. The input boxes for price would then have the name = price[].
Or, would I have to identify the names for the text boxes for each row like this:
Row 1: name=rate[0] name=price[0]
Row 2: name=rate[1] name=price[1]
Row 3: name=rate[2] name=price[2]
etc....?
Then, my insert statement would look like this?
INSERT INTO rates (rate,price) VALUES ($POST['rate'], $POST['price']);
Am I anywhere close?
Thanks for the help.