gpt4 book ai didi

php - 我无法解决此解析错误 : syntax error, 意外 T_WHILE

转载 作者:行者123 更新时间:2023-11-29 12:24:08 24 4
gpt4 key购买 nike

错误:解析错误:语法错误,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>

最佳答案

我已经帮你编辑了

<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>

关于php - 我无法解决此解析错误 : syntax error, 意外 T_WHILE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28594623/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com