codice:
$st=mysql_query("SELECT ID,nome FROM tabella") or die(mysql_error());
$temp=array();
while($row=mysql_fetch_assoc($st))
    $temp[$row['ID']]=$row['nome'];