这是我的代码:
$arr = array(
'cust_id' => "{$_SESSION['cust_id']}"
);
$query = $sql->select_query("code",$arr);
$result = $mysqli->query($query);
while ($row = $result->fetch_assoc()) {
echo "<option name='{$row['pagename']}>{echo $row['pagename']}</option>";
?>
我需要做的就是为每个pagename
打印一个选项,以便在下拉菜单中使用。提前致谢
答案 0 :(得分:0)
while ($row = $result->fetch_assoc()) {
echo "<option name='{$row['pagename']}>{echo $row['pagename']}</option>";
到
<?php
while ($row = $result->fetch_assoc()) {
?>
<option name="<?php echo $row['pagename']; ?>" > <?php echo $row['pagename']; ?> </option>
<?php
} ?>