duanla4959 2013-07-30 17:27 采纳率: 0%
浏览 43
已采纳

下拉列表不起作用

<!--Form to make above array into dropdown-->   
        <html xmlns:o="urn:schemas-microsoft-com:office:office"
        xmlns:x="urn:schemas-microsoft-com:office:excel">
        <html>
        <head>
        <title></title>
        <meta http-equiv="Content-type" content="text/html;charset=utf-8" />
        </head>
        <body>
            <?php     
            $f=mysql_query("show tables from emc");  
            ?>
    <form action="" method="GET">
    <select name="col">
    <option value="">- COLUMN NAME -</option>
          <?php  while($row=mysql_fetch_assoc($f)) {
       foreach($row as $k =>$vv)  {?>
       <option name=<?='$vv'?>><?=$vv?></option>
           <?php   }?>
           <?php   }?>              
           </select>
           <input type="SUBMIT" value="SUBMIT">
           <?php   ?>           
          </form>
         </body>
    </html>

I solve my problem and now its working fine . I was using mysql_fetch_array instead for mysql_fetch_assoc. it was showing me two values but by using assoc , its showing me the result which i want

  • 写回答

1条回答 默认 最新

  • dongzilu0178 2013-07-30 17:55
    关注

    Use mysql_fetch_assoc() to get just an associative array which will end the double-output issue.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Windows Script Host 无法找到脚本文件"C:\ProgramData\Player800\Cotrl.vbs”
  • ¥15 matlab自定义损失函数
  • ¥15 35114 SVAC视频验签的问题
  • ¥15 impedancepy
  • ¥15 求往届大挑得奖作品(ppt…)
  • ¥15 如何在vue.config.js中读取到public文件夹下window.APP_CONFIG.API_BASE_URL的值
  • ¥50 浦育平台scratch图形化编程
  • ¥20 求这个的原理图 只要原理图
  • ¥15 vue2项目中,如何配置环境,可以在打完包之后修改请求的服务器地址
  • ¥20 微信的店铺小程序如何修改背景图