这种循环语句要怎么写才行?在线等!

caobin518 2005-04-22 09:57:10
我的要求为:
从数据库中读取记录,存放在四列的表格中。例如:
1 2 3 4
5 6 7 8
9
因此我写了如下代码,但是一直出错!请高手帮忙。谢谢
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [smallclass]",conn,1,1
if rs.eof then
response.Write "暂时还没有投稿类别"
else
%>
<% do while not rs.eof %>
<td><% =rs("smallclasscn") %></td>
<td><% if rs.eof then response.write " "else rs.movenext%><% =rs("smallclasscn")>
<% end if %></td>
<td><% if rs.eof then response.write " "else rs.movenext%><% =rs("smallclasscn")%>
<% end if %></td>
<td><% if rs.eof then response.write " "else rs.movenext%><% =rs("smallclasscn")%>
<% end if %></td>
<% rs.movenext %><% loop %>
...全文
62 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
coolyqy 2005-04-22
  • 打赏
  • 举报
回复
出什么错,贴出来看看先
zhshtan 2005-04-22
  • 打赏
  • 举报
回复
你的HTML标记也用asp代码写呀。就好控制了。在该出现html标记的地方用response.write("<td>")
你明白吗

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧