【发布时间】:2017-08-17 09:46:44
【问题描述】:
在 php 表单中,我有可从选择字段滚动的品牌列表,我会修改所选品牌,将其显示在旁边的字段中。
php形式是这样的:
<?php
include '../sys/conn.php';
$brands = mysqli_query ($conn, "
*(query to select brands name and id)*
") or die ("Query not valid: " . mysqli_error($conn));
mysqli_close($conn);
?>
...
<form role="form" >
<label>Brands List</label>
<select class="form-control" name='brands list'>
<?php while ($listabrand=mysqli_fetch_array($brands)){
echo '<option>'.$listabrand['0'].' - '.$listabrand['1'].'</option>';
}?>
</select>
...
<label>Modify Brand</label>
<input type="text" name='brand-name' class="form-control" required placeholder="Brand Name to modify">
</form></html>
基本上我需要从命名的“品牌列表”字段中选择品牌名称并将其显示到“品牌名称”中以便修改和保存。
有什么帮助吗?
【问题讨论】: