リクエストを作成するフォームがあります。「Create Request」ボタンをクリックすると、すべての情報が「Requests_Table」に追加されます。これは完全に機能しています。各リクエストには複数のアイテム (少なくとも 1 つ) があり、各アイテムは独自の特性で構成されています (そのため、この情報を別のテーブル 'SerialNumber_Table' に保存したいと考えています。
そのため、シリアル番号情報 (タイプ、モデル、シリアル番号) を「SerialNumber_Table」に挿入するのに助けが必要です。mysql_insert_id();
各シリアル番号を正しい request_id に関連付けるためにも使用する必要があると思います。
` //シリアル番号の変数
$machineType = mysql_prep($_POST['machineType']);
$machineModel = mysql_prep($_POST['machineModel']);
$serialNumber = mysql_prep($_POST['serialNumber']);
<fieldset class="row2">
<h1><?php echo $LANG['hardware_details']; ?></h1>
<p style="margin: 10px 0 10px 0; ">
<p style="margin: 10px 0 10px 0; font-size:12px; padding: 0;"><?php echo $LANG['delete_machines']; ?></p>
<input type="button" value="<?php echo $LANG['add_machines']; ?>" onClick="addRow('dataTable')" style="width: 100px; padding: 2px 5px 2px 5px; background: #e1e1e1; color: #000; font-weight: bold; font-size: 12px; cursor: pointer;" />
<input type="button" value="<?php echo $LANG['remove_machines']; ?>" onClick="deleteRow('dataTable')" style="width: 130px; margin-left: 10px; padding: 2px 5px 2px 5px; background: #e1e1e1; color: #000; font-weight: bold; font-size: 12px; cursor: pointer;" />
</p>
<table id="dataTable" class="form" border="1">
<tbody>
<tr>
<td><input type="checkbox" style=" width: 30px; "/></td>
<td>
<label style="margin-left: 10px;"><?php echo $LANG['machineType']; ?></label>
<input type="text" value="" id="machineType" name="machineType[]" style="width: 70px; margin: 5px 10px 10px 10px; ">
</td>
<td>
<label for="" style="margin-left: 10px;"><?php echo $LANG['machineModel']; ?></label>
<input type="text" value="" id="machineModel" name="machineModel[]" style="width: 70px; margin: 5px 10px 10px 10px;">
</td>
<td>
<label for="" style="margin-left: 10px;"><?php echo $LANG['serialNumbers']; ?></label>
<input type="text" value="" id="serialNumber" name="serialNumber[]" style="width: 120px; margin: 5px 10px 10px 10px;">
</td>
</tr>
</tbody>
</table>
<div class="clear"></div>
</fieldset>
<!-- End Dynamic Forms for Serial Numbers -->
` どうすればそのようなタスクを達成できますか? 参考になれば、このページのコード全体をhttp://aerco.com.br/stackoverflow/source.txtに投稿しました。
誰でもここで正しい方向に向けることができますか? ご意見をお寄せいただきありがとうございます