【发布时间】:2016-10-01 03:30:54
【问题描述】:
<tr>
<td>Platform: </td>
<td><select multiple=\"multiple\" id=\"platform[]\" name=\"platform[]\" size=3>
<option value=\"PC\">PC </option>
<option value=\"PS4\">PS4 </option>
<option value=\"Xbox One\">Xbox One </option>
</select> </td>
</tr>
$artID= $_GET['artID'];
$name2 = testinput($_POST['name']);
$price2 = $_POST['price'];
$VAT2 = testinput($_POST['VAT']);
$description2 = testinput($_POST['description']);
$beschrijving2 = testinput($_POST['beschrijving']);
$foto2 = testinput($_POST['foto']);
$genre2 = testinput($_POST['genre']);
$platform2 = $_POST['platform'];
$sql = "UPDATE `producten` SET genre = \"$genre2\" , platform = \"$platform2\" , beschrijving=\"$beschrijving2\", description=\"$description2\", name = \"$name2\", price = \"$price2\", VAT = \"$VAT2\", foto = \"$foto2\" WHERE `artID` = $artID";
$qresult = $connect1 -> query($sql);
在这里,我试图将多个选择框值插入到我的数据库中,但它在数据库中返回的唯一值是“数组”,我想将它们插入到数据库中,最好在它们之间。我已尝试查找其他解决方案,但似乎找不到适合我的解决方案。
【问题讨论】:
-
您似乎没有任何打开的 PHP 标记...我希望在您的第一行之后有一个
<?php。 -
我只是没有复制粘贴整个东西,我的错
标签: php sql database multipleselection