This is what I want:
foreach($_POST['something'] as $something){
foreach($_POST['example'] as $example){
$query = mysql_query("INSERT INTO table (row, row2) VALUES ('{$something}','{$example}')");
}
}
$_POST['something']
and $_POST['example']
are arrays from an input with
name="something[]"
and name="example[]"
.
The problem:
In this way I will send the data twice to database. So I need a solution where I can loop trough 2 arrays without seding the data twice.
EDIT
- The two array will always have the same size
- In the mysql_query I will have other elements not just row, row2, and those will be static without any array.