情况很简单,发现这很奇怪为什么我在组合框(下拉菜单)中的每个结果后都无法插入图像。
我想在这里插入$ 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/>