try this code it works for me

[CODE]

<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="forum"; // Database name
$tbl_name="test_mysql"; // Table name

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$sql="SELECT * FROM test_mysql";
$result=mysql_query($sql);

?>

<form name="form1" method="post" action="">
<select name="Names" id="Names">
<?php

while($rows=mysql_fetch_array($result, MYSQL_ASSOC))

{

echo"<option>". $rows['name']."</option>"; //to display names from database in field called name

}

mysql_close();
?>

</select>
</form>

[/CODE]

nav33n commented: Thanks for the rep man. I am not good enough though. I m still learning. +1