più o meno lo avevi già scritto nel tuo php!
Codice PHP:
if (!$result)
die('Errore nella query' . mysql_error());
else {
while($row=mysql_fetch_assoc($result))
echo "<option value=" . $row['Cognome'] . ">" . $row['Cognome'] . "</option>";
}
ma più che un cmapo intero nell'option semrpe meglio inserire un ID in modo che poi con una query sql puoi recuperare l'intero record...questo per non sprecare troppa memoria!!
Codice PHP:
if (!$result)
die('Errore nella query' . mysql_error());
else {
while($row=mysql_fetch_assoc($result))
echo "<option value=" . $row['ID_Cognome'] . ">" . $row['Cognome'] . "</option>";
}