Many thanks for the reply peter. I 've runned it and show it. It's very good.
The thing is that i have my project almost ready and our teacher asked us not to use servlets.
So i'm stack with it.:-O:(
I can make a selection in my query like :
SELECT ID,TITLE FROM SCHOOL ORDER BY ID
but i don't know how only id will be passed to student's table
For example: The student can see a form with : New York School , London School , Dublin School. But when he choose London School and submits id=23 must be written in student's table.
I've tried so many things.I have a headache!:confused:
<td>
<select name="SCHOOL_ID" />
<%
Class.forName("com.mysql.jdbc.Driver");
java.sql.Connection connection =java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/dbproject1","kostas9", "");
String query1 ="SELECT TITLE , ID FROM SCHOOL ";
java.sql.PreparedStatement Stmt1 = connection.prepareStatement(query1);
ResultSet rs = Stmt1.executeQuery();
while (rs.next()) {
out.print("<option>");
out.print(rs.getString("TITLE"));
out.print("</option>");
}
%>
</select>
</td>