0
我正在酒店功能頁面上工作。PHP Array數據庫輸入名稱
的代碼,我被困在peice的是:
<?php
$result = mysqli_query($conn, "select * from facilities_type");
while($row = mysqli_fetch_assoc($result))
{
?>
<tr>
<th scope="row">
<input class="form-check-input" type="checkbox" id="blankCheckbox" name="room_feature_cb[]" value="<?php echo $row["facilitiestype_id"]; ?>">
</th>
<td>
<?php echo $row["room_facilities"] ?>
</td>
<td>
<img src="upload-img/icon/<?php echo $row["facilities_icon"]; ?>" width="25">
</td>
</tr>
<?php
}
?>
我想利用數組保存數據,但我不能得到名稱保存到數據庫中
if (isset($_POST["room_feature_savebtn"]))
{
$feature = $_POST['room_feature_cb'];
for($result=0;$result>$feature;$result++)
{
mysqli_query($conn,"insert into facilities_details(facilitiestype_id) value ('$feature')");
}
}