我正在尝试从数据库中获取一些数据到下拉列表。但这行不通。这是我的代码。谢谢
<div class="col-md-5">
<select multiple class="form-control" style="height: 100px" id="experienceEdit">
<?php
$sqlVessel = "SELECT * FROM vessel_types ORDER BY vessel_types ASC";
$resultVessel = $conn->query($sqlVessel);
if ($resultVessel->num_rows > 0) {
// output data of each row
while ($rowVessel = $resultVessel->fetch_assoc()) {
?>
<option class="experienceValEdit" value="<?php echo $rowVessel['idvessel_types']; ?>"><?php echo $rowVessel['vessel_types']; ?></option>
<?php
}
} else {
}
?>
答案 0 :(得分:0)
选中此行。
if ($resultVessel->num_rows > 0) {
应该有一个-
我认为这会产生一些错误。 @usinshif