我想通过不同的下拉列表显示不同列的数据。每个下拉列表将显示不同表格的数据。这是我的脚本,但它仅在一个下拉列表中显示所有数据。
<?php
$db = mysql_connect('localhost', 'root', '') or
die ('Unable to connect. Check your connection parameters.');
mysql_select_db('mobiledb', $db) or die(mysql_error($db));
?>
<html>
<head>
<title>rest</title>
</head>
<body>
<form action="commit.php method="post">
<table>
<tr>
<td>Movie Type</td>
<td><select name="movie_type">
<?php
$query = 'SELECT
customer_id, customer_name, customer_address, customer_order
FROM
customers';
$result = mysql_query($query, $db) or die(mysql_error($db));
while ($row = mysql_fetch_assoc($result))
{
echo '<option value="' . $row['customer_id'] . '"> ' . $row['customer_name'] . '</option>';
echo '<option value="' . $row['customer_id'] . '"> ' . $row['customer_address'] . '</option>';
echo '<option value="' . $row['customer_id'] . '"> ' . $row['customer_order'] . '</option>';
}
?>
</select></td>
</tr>
</table>
</form>
</body>
</html>