asp循环行数输出函数

2018-09-06 13:20

阅读:526

  经过大鸟哥的指导已做全面的修改,本人能力有限只能做到下面这步了:

ASP/VisualBasic代码
复制代码 代码如下:
<%
Constp=6每页2条
setrs=server.createobject(adodb.recordset)
sql=Select*fromshoworderbyidDesc
rs.Opensql,conn,1

i=0
dowhilenotrs.eof
%><tdalign=centerheight=98>
<ahref=show.asp?id=<%=rs(id)%>>
<imgsrc=<%=rs(pic)%>width=150height=98alt=<%=rs(name)%>/></a>
</td>
<%
If(i+1)Mod3=0Then
Response.Write</tr>
Ifi<(p-1)ThenResponse.Write<tr>
EndIf
i=i+1
ifi>pthenexitdo
rs.movenext
Loop
IfiMod3<>0Then
Form=3-(iMod3)To1Step-1
response.write<td></td>
Next
response.write</tr>
EndIf
Ifi=3Then
response.write<td></td><td></td><td></td></tr>
Endif
rs.close
setrs=nothing
%>



之前的代码未更改

复制代码 代码如下:
<%
Constp=6每页2条
setrs=server.createobject(adodb.recordset)
sql=Select*fromshoworderbyidDesc
rs.Opensql,conn,1

i=1
dowhilenotrs.eof
%><tdalign=centerheight=98>
<ahref=show.asp?id=<%=rs(id)%>>
<imgsrc=<%=rs(pic)%>width=150height=98alt=<%=rs(name)%>/></a>
</td>
<%
ifimod3=0then
Response.Write(</tr><tr>)
endif
i=i+1
ifi>pthenexitdo
rs.movenext
Loop
rs.close
setrs=nothing
%>


评论


亲,登录后才可以留言!