![](/img/trans.png)
[英]inside the echo, why the php variable can't be printed with html tag
[英]Any suggestions to why the </option> tag does not get printed at end of second echo?
打印第二個echo語句時不帶結束</option>
標記。 但是可以正確打印其余代碼。 如果我檢查HTML,則將文本Any Publisher ...留在''單引號中。 謝謝
function getPublishers (){
$sql = "SELECT DISTINCT publisher FROM book ORDER BY publisher ASC";
$rs = mysql_query($sql) or die(mysql_error());
$rows = mysql_fetch_assoc($rs);
$tot_rows = mysql_num_rows($rs);
if($tot_rows>0){
echo "<select name=\"srch_publisher\" id=\"srch_publisher\>\n";
**echo "<option value\"\">Any Publisher…*</option>*\n";**
do{
echo "<option value=\"".$rows['publisher']."\">".$rows['publisher']."</option>";
} while($rows = mysql_fetch_assoc($rs));
echo "</select>";
}
mysql_free_result($rs);
}
您在id="srch_publisher"
之后缺少id="srch_publisher"
:
echo "<select name=\"srch_publisher\" id=\"srch_publisher\>\n";
↑
missing closing quote (") at this position
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.