<?php
$sql = "(SELECT dari FROM mapping WHERE author = '$_SESSION[user]')
UNION
(SELECT ke FROM mapping WHERE author = '$_SESSION[user]')";
$run = mysqli_query($conn, $sql);
while ($rows = mysqli_fetch_assoc($run)) {
if(!empty($rows['dari'])) {?>
<option value="<?php echo $rows['dari']; ?>"><?php echo $rows['dari']; ?></option> <?php
} else {?>
<option value="A1">A1</option><?php
}
}
?>
带有值A1的菜单选项不能以
的形式出现答案 0 :(得分:0)
您需要至少输入一次
do
{
$rows = mysqli_fetch_assoc($run);
if (null !== $rows && !empty($rows['dari']))
{ ?>
<option value="<?php echo $rows['dari']; ?>"><?php echo $rows['dari']; ?></option> <?php
}
else
{ ?>
<option value="A1">A1</option><?php
}
} while ($rows);