prova con
codice:mysql_select_db($xx, $yy); $query_res = "SELECT * FROM professori"; $res = mysql_query($query_res, $yy) or die(mysql_error()); $row_res = mysql_fetch_assoc($res); $totalRows_res = mysql_num_rows($res); // evidentemente inizia un campo form <select name="select"> <?php do { ?> <option value="<?php echo $row_res['NOME CAMPO ID PROBABILMENTE'];?>"><?php echo $row_res['NOME PROF'];?></option> <?php } while ($row_res = mysql_fetch_assoc($res)); $rows = mysql_num_rows($res); if($rows > 0) { mysql_data_seek($res, 0); $row_res = mysql_fetch_assoc($res); } ?> </select>(testato, ovviamente devi mettere i nomi di variabili giuste: $row_res['NOME CAMPO ID PROBABILMENTE']--> sarà il campo id univoca che identifica il prof (dipende da come hai progettato la tabella); $row_res['NOME PROF'] --> il nome della colonna che ha i nomi dei prof.

(testato, ovviamente devi mettere i nomi di variabili giuste: $row_res['NOME CAMPO ID PROBABILMENTE']--> sarà il campo id univoca che identifica il prof (dipende da come hai progettato la tabella); $row_res['NOME PROF'] --> il nome della colonna che ha i nomi dei prof.
Rispondi quotando