Depending on your form, it might be easy to use the handy array syntax.
eg:
Code:
<!-- your html form - excuse the shoddy form -->
<form ACTION="this.php" METHOD="POST">
<table>
<tr>
<td><input type="text" size="10" name="name[]"></td>
<td><input type="text" size="2" name="age[]"></td>
</tr>
<tr>
<td><input type="text" size="10" name="name[]"></td>
<td><input type="text" size="2" name="age[]"></td>
</tr>
</table>
</form>
So we have two rows both prompting for name and age. In php, just loop through the array and insert.
PHP Code:
if (sizeof($name) > 0) {
$db = new DB; //however you get your db object.
foreach ($name as $k => $v) {
$q = <<<EOQ
INSERT INTO table_name (name_field, age_field)
VALUES (
'{$name[$k]}',
'{$age[$k]}'
)
EOQ;
$db->query($q);
}
}
else {
echo 'No data!! ahh';
}
If you didn't use the array var syntax in your form, you could still do something similar, but it might be more difficult. eg: name your vars with the row number then do a for() loop for the number of rows you have.
-r