I have an idea how to do this, but never did it before

heres my code:

<label for="weatherCity">City:</label>
<select name="weatherCity" id="Cities">
<option value="0"> </option>

here's my query:

SELECT distinct state
FROM ols_weather_current
ORDER BY 1 asc;

Connection connection;
PreparedStatement pstmt;
ResultSet rst2;


try { // execute the query
connection = DataBaseConnectionManager.getConnection();
String sqlQuery = "SELECT distinct state FROM ols_weather_current
    ORDER BY 1 asc";
pstmt = connection.prepareStatement(sqlQuery);
ResultSet rst2;

rst2 = pstmt.executeQuery(sqlQuery2);

%>
<tr>
<td> State:
<select>;
<% while (rst2.next ()) {

}  ("</select>");
%>

Im not sure how to set up the while statement...any help would be appreciated


thanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.