Ok, that should be no problem.
A select looks like this:
HTML Code:
<select>
<option value = "value">Some text</option>
<option value = "value">Some text</option>
</select>
What should the value in the option be?
The employee's id?
What should "Some text" be?
The employees name?
Edit:
I've just coded up something along these lines:
If you alter your "toselectdropdown.php" file like this:
PHP Code:
<?php $con = mysql_connect("localhost","root","*****");
if (!$con){
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$result = mysql_query("SELECT * FROM employee");
while($row = mysql_fetch_array($result)){
$empdata[$row['id']] = $row['emp_name'];
}
mysql_close($con);
echo json_encode($empdata);
?>
Then use the JavaScript code from post 22 to create the drop down, you should see something approaching what you are trying to achieve.
It's not the finished product, but let me know if this works for you.