读取两个表的信息,循环插入在<select name="select" id="select">时出错了

yuhouqingchen2020 2015-10-26 11:32:00
String sql = "select * from tb_ZhiHang order by zhid ";

ResultSet rs = stmt.executeQuery(sql);

String sql2 = "select * from tb_KeHu_GeRen ";

ResultSet rs2 = stmt.executeQuery(sql2);


....
<tr align="left" bgcolor="#FAFAF1" height="22">
<td width="171" height="30">选择支行:</td>
<td width="1024" height="30" align="left">
<select name="zhihang" id="zhihang">
<option value="0" selected>请选择</option>
<%
while (rs.next()){

%>
<option value="<%=rs.getString("zhid")%>"><%=rs.getString("zhname")%></option>

<%
}
%>
</select></td>
</tr>
.....
<tr align="left" bgcolor="#FAFAF1" height="22">
<td width="171" height="30">选择客户:</td>
<td width="1024" height="30" align="left">

<select name="select" id="select">
<%
while (rs2.next()){

%>
<option value="<%=rs2.getString("zhid")%>"><%=rs2.getString("zhname")%></option>

<%
}
%>
</select></td>
</tr>
...全文
86 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
wrong1111 2015-10-26
String sql = "select * from tb_ZhiHang order by zhid "; ResultSet rs = stmt.executeQuery(sql); String sql2 = "select * from tb_KeHu_GeRen "; ResultSet rs2 = stmt2.executeQuery(sql2);
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2015-10-26 11:32
社区公告
暂无公告