Ik heb deze code in mijn formulier staan:
Hoe moet ik nu verder om de array te kunnen gebruiken? Ik loop vast op:
PHP:
<?php for ($i=0; $i<=4; $i++)
{ ?>
<tr>
<td>
<?php echo $calculatie[$i]; ?>
<?php if($error_aantal[$i] == "ja"){ $error_omschr = $error_omschr_aantal[$i]; include('includes/input_error.php'); } ?> <textarea rows="7" cols="80" name="omschrijving[]" /><?php echo $omschrijving[$i]; ?></textarea>
</td>
<td>
<select multiple="multiple" width="50" size="7" name="calculatie[]" style="width: 150px">
<?php
$sql_calc = "select id, naam from calculatie WHERE offerte_id = '".$row['off_offerte']."' ORDER BY id ASC";
$res_calc = mysql_query($sql_calc,$con);
while ($row_calc = mysql_fetch_assoc($res_calc)){
?>
<option value="<?php echo $row_calc["id"] ?>"><?php if (empty($row_calc["naam"])) { echo $row_calc["id"]; } else { echo $row_calc["naam"]; } ?></option>
<?php } ?></select>
</td>
</tr>
<?php } ?>
Hoe moet ik nu verder om de array te kunnen gebruiken? Ik loop vast op:
PHP:
for ($i=0; $i<=4; $i++)
{
$omschrijving[$i] = trim(mysql_real_escape_string($_POST['omschrijving'][$i]));
foreach(mysql_real_escape_string($_POST['calculatie'][$i]) AS $calculatie_id[$i]);
}