「看護師」テーブルから看護師の既存の「名」を表示するために、フォーム内の選択ボックスに入力するのが困難です。誰が私が間違っているのか教えてもらえますか? 前もって感謝します!
フォームはこちら
<form method="post" action="insert.php">
<br>
<tr><td align="left"><strong>Nurse Information</strong></td>
</td>
<tr>
<td>nurse_name</td>
<td><select name="valuelist">
<option value="valuelist" name="nurse_name" value='<?php echo $nurse_name; ?>'></option>
</select></td>
<tr>
nurse_forename に入力する必要がある QUERY:
<html><head><title>Connect to Database</title></head><body>
<font size="4">Query gets Forename of nurse</font>
<br><br><font size="4">Choose a name</font><br><br>
<form action="insert.php" method="post">
<select name="valuelist">;
<?php
$value=$_POST ["valuelist"];
$con = mysql_connect("localhost","root","") or die('Could not connect: ' . mysql_error());
mysql_select_db("a&e", $con) or die('Could not select database.');
$fetch_nurse_name = mysql_query("SELECT DISTINCT $nurse_name FROM nurse");
$result = mysqli_query($con, $query) or die("Invalid query");
while($throw_nurse_name = mysqli_fetch_array($fetch_nurse_name)) {
echo '<option value=\"'.$nurse_name['nurse_name'].'">'.$throw_nurse_name['nurse_name'].'</option>';
}
echo "</select>";
mysqli_close($con);
?>
<input type="submit" value="Submit">
</form></body></html>