5

求php两个下拉列表联动解决办法.

图片说明
选择科室后,对应员工姓名根据选择的科室获取,怎么做到。
两个列表的代码:

```


echo "-请选择-  ";
<?php
@include "conn.php"; //链接数据库
$gzh_num_result=mysql_query("select gzh_num , gzh_name from gongzhong where gzh_renum=0 order by gzh_num ;");
while($gzh_num_row=mysql_fetch_array($gzh_num_result))
{

list($gzh_num,$gzh_name)=$gzh_num_row;
    echo "<option value=".$gzh_num.">".$gzh_name."&nbsp;&nbsp;</option>";
        //  echosuboption($gzh_num,@$_GET['gzh_num']);

};
?>
</select>
    </td>   
    <td><select name="yg_num" >
    echo "<option value=0>-请选择-&nbsp;&nbsp;</option>";
      <?php

$yg_num_result=mysql_query("select yg_num , yg_name from yuangong where gzh_renum=01 order by yg_num ;");
while($yg_num_row=mysql_fetch_array($yg_num_result))
{   
    list($yg_num,$yg_name)=$yg_num_row;

    echo "<option value=".$yg_num.">".$yg_name."&nbsp;&nbsp;</option>";

};
?>
</select></td>

查看全部
guoziyi01
Destiny丶
2015/07/28 12:09
  • php
  • 下拉菜单
  • 数据库
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

3个回复