Hello
with this script I need to show the user (utenti) list and after I need to
input in the table RICHIESTA the field COGNOME e NOME.
This is the code but don't go. Someone can tell me where is the mistake???
Many Thanks!!
<select name="user" id="user">
<?
$q= mysql_query("select * from utenti order by user");
while ($res=mysql_fetch_array($q))
{
echo "<OPTION VALUE=\"$res[user]\">$res[user] --
$res[reparto]</OPTION>";
}
mysql_free_result($q);
$rs = mysql_query("SELECT * FROM utenti WHERE user = ".$user);
$cognome = mysql_result($rs, 0, "cognome");
$nome = mysql_result($rs, 0, "nome");
mysql_query("INSERT INTO richiesta (cognome,nome) VALUES
($cognome,$nome)");
?>
</select>