0

Please take a lot at this. Tomcat is reporting the variable editQuestion cannot be resolved.

<%
String key = request.getParameter("edit");
  ResultSet columns1 = statement.executeQuery("SELECT * FROM Questions WHERE ID ="+ key +"");
  
  while(columns1.next())
  {
    String editid = columns1.getString("ID");
    String editQuestion = columns1.getString("Question");
    String editAnswer = columns1.getString("Answer");
	String editUpdated = columns1.getString("Timestamp");
	String editAuthor = columns1.getString("Author");	
}
%>
<form action="viewFAQ.jsp" method="get">
<INPUT readonly TYPE="TEXT" NAME="ID" value="<%= key %>">
<TEXTAREA NAME="comments" COLS="40"ROWS="6"><%= editQuestion %></TEXTAREA>
</form>

Thanks :)

1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by eddy556
0

Hey, I've managed to solve this....turns out I had to declare the variables i.e. String question = null; outside the loop.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.