1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <tr>
<td>Profil:</td>
<td>
<select name="profil" id="profil">
<% Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/gestion_parc", "root", "");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT libelle, id FROM profils;");
rs.last();
int nb=rs.getRow();
rs.beforeFirst();
int i = 1;
while(rs.next()){
rs.absolute(i);
String code = rs.getString(2);
String lib = rs.getString(1);
%>
<option value="<%=code%>"><%=lib%></option>
<%}%>
</select>
<p></td>
</tr> |
Partager