इसे आजमाएं:
<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 Forename FROM nurse");
while($throw_nurse_name = mysql_fetch_array($fetch_nurse_name)) {
echo '<option value=\"'.$throw_nurse_name[0].'">'.$throw_nurse_name[0].'</option>';
}
echo "</select>";
?>
<input type="submit" value="Submit">
</form></body></html>
एक साथ mysql और mysqli का उपयोग न करें .... आपको mysqli या PDO का उपयोग करना चाहिए, लेकिन दोनों का मिश्रण नहीं;)PS:संपादित;)
सैल्यूडोस।