错误:解析错误:语法错误,C:\ Program Files(x86)\ EasyPHP-5.3.5.0 \ www \ Pharmaceutical Distribution System \ PDS \ add-department-1.php 149行的意外T_WHILE
这是我的php代码,用于从php mysql动态添加选项。
<div class="form-group">
<label>Department</label>
<select class="form-control" name="Department" required>
<option>Select Department</option>
<?php
$link = mysqli_connect("127.0.0.1", "root", "");
$SqlResult = mysqli_query($link, "SELECT department_name from department_master");
mysql_select_db('pds',$link)
while($Row = mysqli_fetch_array($SqlResult))
{
?>
<option value="<?php echo $Row['department_name']; ?>"></option>
<?php
}
?>
</select>
</div>
答案 0 :(得分:1)
我已为你编辑
<div class="form-group">
<label>Department</label>
<select class="form-control" name="Department" required>
<option>Select Department</option>
<?php
$link = mysqli_connect("127.0.0.1", "root", "");
mysql_select_db('pds',$link);
$SqlResult = mysqli_query($link, "SELECT department_name from department_master");
while($Row = mysqli_fetch_array($SqlResult))
{
?>
<option value="<?php echo $Row['department_name']; ?>"><?php echo $Row['department_name']; ?></option>
<?php
}
?>
</select>
</div>