posto il codice... magari è di aiuto:

codice:
<html>
<select name="selezione">
<php
$sql="SELECT nome,codice FROM tabella ORDER BY id";
$res=mysql_query($sql,$db);
while($row=mysql_fetch_array($res))
{
    print"<option value=\"".$row[codice]."\">".$row[nome]."</option>";
}
?>
<html>