我的问题是没有将我的选择框连接到我的数据库,但获取信息显示....它连接,我可以看到我的数据库表中的项目数量的框,但没有任何文本他们我的数据库表是.CSV我不确定这是否会导致问题?
这是我的代码:在我的代码中,我将放入虚拟_....(什么是项目)而不是真实的东西。
<?php
require_once('auth.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<link href="styles/stylesheet.css" rel="stylesheet" type="text/css">
<head>
</head>
<body>
<form id="dropdown">
<?php
mysql_connect("localhost", "repaiami_member", "zmozmozm2083") or die("Connection Failed");
mysql_select_db("repaiami_member")or die("Connection Failed");
?>
<?php
$query = "SELECT * FROM lighting";
$result = mysql_query($query);
?>
<table width="450px;">
<tr>
<td>
<select id="dropdown_description" name="select1" class="ui-select selBox">
<?php
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<option value="<?php echo $line['field'];?>"> <?php echo $line['field'];?></option>
<?php } ?>
</select>
</td>
<td>
<input type="text" name="first_name" maxlength="50" size="30">
</td>
</tr>
</table>
</form>
</body>
</html>
有人可以帮忙吗?