以下是代码,html页面,很简单的建立了一个和数据库连接的select标签
=======================================================================
<html>
<head>
<script src="selectgid.js"></script>
</head>
<body>
<form>
<select name="users" onchange="showUser(this.value)">
<?php require_once ("inc/conn.php");?>
<option VALUE="0">请选择 </option>
<?php $sql=$db->query("select g_website.title,wid,g_game1.id from g_game1,g_website where bjq_id =(select bjq_id from g_game1 where id =1) and wid=g_website.id");
$i=0;
$array= array();
while($rs=$db->fetch_array($sql)){
$array[$i++]=$rs['id'];
?>
<option value="<?php echo $rs['id']?>"><?php echo $rs['title'];}?></option>
</select>
</form>
<p>
<div id="txtHint"></div>
</p>
</body>
</html>
=======================================================================
<html>
<head>
<script src="selectgid.js"></script>
</head>
<body>
<form>
<select name="users" onchange="showUser(this.value)">
<?php require_once ("inc/conn.php");?>
<option VALUE="0">请选择 </option>
<?php $sql=$db->query("select g_website.title,wid,g_game1.id from g_game1,g_website where bjq_id =(select bjq_id from g_game1 where id =1) and wid=g_website.id");
$i=0;
$array= array();
while($rs=$db->fetch_array($sql)){
$array[$i++]=$rs['id'];
?>
<option value="<?php echo $rs['id']?>"><?php echo $rs['title'];}?></option>
</select>
</form>
<p>
<div id="txtHint"></div>
</p>
</body>
</html>