</form>
<?php
// definizione delle variabili per connettersi al db
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_nome="automobili"; // Database name
$tbl_nome="alimentazione"; // Table name

// Procedimento per connettersi al Database
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_nome")or die("cannot select DB");

$sql = "SELECT id, carburante FROM $tbl_nome" ;// seleziona i due campi dalla tab
$risultato = mysql_query ( $sql );

$options = "" ;

while ( $row = mysql_fetch_array ( $risultato )) { // cera un arrey con i risultati



$id = $row [ "id" ];
$carburante = $row [ "carburante" ];
$options .= "<OPTION VALUE=\"$id\">" . $carburante ;
}

?>


<SELECT NAME=thing>
<OPTION VALUE=0>Choose
<?=$options?>
</SELECT>




questo è il codice che mi permette di fare un elenco a tendina dei valori che tengo nella tabella alimentazione ....
Come faccio a inserire il valore che seleziono in un altra tabella ?
se ti occorre ti invio un dumb del db!!!!

ho provato a fare un echo della variabile $options ma non mi stampa nessun valore!!!