hi all, how do i use a drop down box to show my fields in my sql table ? below is what i have so far, i need to display all of the EmployeeIDs in the drop down box.

<select  name="name">
			   <?php
			   $sqlName="SELECT * FROM employeedetails";
$queryName = mysql_query($sqlName,$connection);
$recordName = mysql_fetch_assoc($queryName);
$EmployeeID=$recordName['EmployeeID'];
echo $recordName['$EmployeeID'];
?>

            </select>

Try this.

<?php

// your database connection here

echo "<select name='dropdown1'>";
$query = mysql_query("SELECT * from employeedetails");
while($result=mysql_fetch_array($query));
{
echo "<option name='id_list'>".$result['EmployeeID']."</option>";
}

echo "</select>";

?>

Also use value in option tag.
Because it may cause issue in IE.

<?php

// your database connection here

echo "<select name='dropdown1'>";
$query = mysql_query("SELECT * from employeedetails");
while($result=mysql_fetch_array($query));
{
echo "<option value='".$result['EmployeeID']."' name='id_list'>".$result['EmployeeID']."</option>";
}

echo "</select>";

?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.