情况非常简单,我发现这很奇怪,为什么我无法在组合框(下拉菜单)中的每个结果之后插入图像。
我正在尝试在此处插入 $image!。
<select name = 'pSelect' id = 'pSelect'>
<?php
$result = mysql_query
("
SELECT ID, Project, Projectnummer, Klant
FROM tblproject
WHERE Status = '1'
ORDER BY Klant ASC
");
$image = "<img src='images/status_groen.png' width='15' height='15' /> ";
while($row1 = mysql_fetch_array($result))
{
$pID = $row1['ID'];
echo "<option value=\"" . $row1['ID'] . "\"";
if (isset($_POST['pSelect']) && $row1['ID'] == $_POST['pSelect'])
{
echo " selected='selected'";
}
echo ">" . $row1['Klant'] ." ". $row1['Project'] ." ". $row1['Projectnummer'] ." ".$image. "</option>";
echo "<br/>'";
}
?>
</select>
数据输出后,它以红色显示图像语法,表明它可能是语法问题,但不是必须的。
源输出:
<option value="202">3DNL reCAPTCHA toevoegen 13097/1 <img src='images/status_groen.png' width='15' height='15'/> </option><br/>