Home > Backend Development > PHP Tutorial > 下拉菜单-求php两个下拉列表联动解决办法.

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-02 11:31:05
Original
1260 people have browsed it

php下拉菜单数据库

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

```


echo "-请选择-  ";
@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;
<code>    echo "<option value=".$gzh_num.">".$gzh_name."  </option>";        //  echosuboption($gzh_num,@$_GET['gzh_num']);};?>           <td><select name="yg_num">    echo "<option value="0">-请选择-  </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."  ";};?></select></td></code>
Copy after login
<code></code>
Copy after login
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template