drxpt06820 2013-03-30 17:16
浏览 42
已采纳

PHP查询选项定义中的PHP下拉框

I have been trying to decipher the option part of this: echo "<option value='" . $row['PcID'] . "'>" . $row['PcID'] . "</option>"; taken from Populate a Drop down box.....

can someone kindly explain what the periods do? and why when i do this: print "<option value='".$wrow['week_num']."'>".$wrow['week_name']."</option><br> "; I only get only the week name in the list.

$wquery="select week_num,week_name from stats_week";
$wresult=mysql_query($wquery);
print "Select Week:<select name=Week_select><br>
";
while ($wrow=mysql_fetch_assoc($wresult)){
    print "<option value='".$wrow['week_num']."'>".$wrow['week_name']."</option><br>
";    
}
print "</select>";
  • 写回答

3条回答 默认 最新

  • dongshenjie3055 2013-03-30 17:19
    关注

    In PHP, the period is the concatentation operator. Putting the periods in tells PHP to concatenate strings, See this page:

    http://www.php.net/manual/en/language.operators.string.php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 luckysheet
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误