简单问题在线结贴

xuefeifangpei 2004-09-13 10:52:12
一下代码实现下拉筐数据不是写死的而是从数据库动态提取,按照一下代码写出来是这样显示的
清华大学出版社 电子工业出版社 中国铁道出版社 人民邮电出版社 而不是下拉筐
<%
String book_cbs;

ResultSet RS1 = workM.executeQuery("select * from book_cbs");
try
{
while(RS1.next())
{


book_cbs=getStr(RS1.getString("cbs_name"));
if (book_cbs==null)
book_cbs="空";

%>
<option value="<%=book_cbs%>"><%=book_cbs%></option>

</select>
<%

}
}
catch(Exception e)
{
out.println(e);
}
%>
...全文
50 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
yrne 2004-09-13
<select>
<%
String book_cbs;

ResultSet RS1 = workM.executeQuery("select * from book_cbs");
try
{
while(RS1.next())
{


book_cbs=getStr(RS1.getString("cbs_name"));
if (book_cbs==null)
book_cbs="空";

%>
<option value="<%=book_cbs%>"><%=book_cbs%></option>
<%

}
}
catch(Exception e)
{
out.println(e);
}
%>
</select>
回复
xunyiren 2004-09-13
<select>
<%
String book_cbs;

ResultSet RS1 = workM.executeQuery("select * from book_cbs");
try
{
while(RS1.next())
{


book_cbs=getStr(RS1.getString("cbs_name"));
if (book_cbs==null)
book_cbs="空";

%>
<option value="<%=book_cbs%>"><%=book_cbs%></option>
<%

}
}
catch(Exception e)
{
out.println(e);
}
%>
</select>
回复
wangyhlj 2004-09-13
<select>
<%
String book_cbs;

ResultSet RS1 = workM.executeQuery("select * from book_cbs");
while(RS1.next())
{


book_cbs=getStr(RS1.getString("cbs_name"));
if (book_cbs==null)
book_cbs="空";

%>
<option value="<%=book_cbs%>"><%=book_cbs%></option>

<%

}
%>

</select>

回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2004-09-13 10:52
社区公告
暂无公告