Hey lads,
Just have a small query here thats really bugging me. When details are entered by user and checked in database, the program should display one of two messages as seen below. When the details are entered correctly the welcome message displays correctly. However, when incorrect details are entered, the second message does not display. In fact, there is a blank screen. Anyone have any ideas?
<%ResultSet rs = stmt.executeQuery ("SELECT * from table where name='" + request.getParameter ("name")+"'");%>
<%while (rs.next()){
String st_id = rs.getString ("name");
if(st_id.equals(request.getParameter ("name"))){
out.print("Welcome " + request.getParameter ("name"));
}else {
out.print("Please try again.");
}
}
%>