I have a 5 tables like this:
prices:
priceList_id    product_id  compType_id     price   range_id 
priceList:
id  name 
products:
 id     product_desc 
companyType:
 id     type 
pricesRange:
 id     range_desc 
the prices table is where i store everything and link with the other tables ids like this:
id  priceList_id    product_id  compType_id     price   range_id
 1      1                1           5          23.10      1
 2      1                1           5          21.30      2
The problem is when i recive the data and try to insert it to the DB:
<input name=\"price[]\" type=\"number\" min=\"0\" required>
<input name=\"price[]\" type=\"number\" min=\"0\" required>
<input name=\"price[]\" type=\"number\" min=\"0\" required>
<input name=\"price[]\" type=\"number\" min=\"0\" required>
<input name=\"price[]\" type=\"number\" min=\"0\" required>
i get the post like this:
if (isset($_POST["createPriceList"])) {
            $this->createPriceList($_POST["price"]);
        }
So $_POST["price"] is an array. How can i insert the data into the price table knowing that the 1st input is product_id: 1, compType_id: 5, range_id: 1. the 2nd input is product_id: 1, compType_id: 5, range_id: 2 and the 3rd input is product_id: 1, compType_id: 5, range_id: 3 and so on... There are 6 range_id´s, 4 products_id´s and 5 compType_id`s.
Thanks in advance!
createPriceList()does?print_r($_POST["price"]);should do the trick.