This is nothing new. Pulling data from a column in a table to populate a drop down menu in a form. My problem is that I'm restricted to ODBC and don't have the mySQL tools available to me. I tried to translate the tutorials I could find to make this work but this ugly snipet is all I could come up with. There has to be some concept I am missing preventing me from cleaning this up.
The Usr_Id is the value of the select
The Usr_First and Usr_Last should be joined with a space for the selections.
Any one with ideas?
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo '<form method="POST" action="#">';
echo '<select name="employee">';
while (odbc_fetch_row($rs))
{
$id=odbc_result($rs,"Usr_ID");
$fname=odbc_result($rs,"Usr_First");
$lname=odbc_result($rs,"Usr_Last");
echo '<option value="$id">';
echo "$fname ";
echo "$lname</option>";
}
echo '</select></form>';