I get 2 fields from my html form that store the value in an Array .
$ingredients = $_POST['ingredients'];
$quantity = $_POST['quantity'];
I want to insert these values into my mysql db. Therefore, I use the following:
foreach($ingredients as $in)
{
foreach($quantity as $q)
{
echo "Intredent and quantity is : $in and $q<br/>";
//$insert = my mysql Insert query;
}
}
But it shows twice the value. For example: if value 2 has value 4, etc.
source
share