
<li role="presentation">
<a role="menuitem" tabindex="-1" href="#">阳台新风机</a>
</li>
<li role="presentation">
<a role="menuitem" tabindex="-1" href="#">办公室新风机</a>
</li>
拼接上去就好
<?php$con = mysql_connect("localhost","root","")//连接数据库
mysql_select_db('test')//选择数据库
?>
<html>
<head>
<title>dropdown from mysql</title>
</head>
<body>
<h1>dropdown from mysql</h1>
<form action="#" method="post">
<select>
<option value=0>--请选择--</option>
<?php
$sql= "select val from custom where field='hook_load'"//sql语句
$result = mysql_query($sql, $con)//执行sql语句
while($row = mysql_fetch_array($result))
{
echo "<option value='$row[val]'>$row[val]</option>"//循环,拼凑下拉框选项
}
?>
</select>
</form>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)