asp代码怎样改成4行5列
原来的代码是这样的sql="select*fromphotowhereclass1="&cid&"orderbyiddesc"'response.writesqlSetR...
原来的代码是这样的
sql="select * from photo where class1="&cid&" order by id desc"
'response.write sql
Set Rs=Server.CreateObject("adodb.recordSet")
Rs.Open SQl,Conn,3,1
if not rs.eof then
page=Clng(request("page"))
rs.pagesize=9
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.Absolutepage=page
for i=1 to rs.pagesize
if rs.eof then exit for
%>
高手帮帮忙
接上面的
<tr height="10">
<td width="100" height="10" align="left" ><a href="#">
<img width=100 src="administrator/photo/upfile/<%=rs("pictype")%>" alt="<%=rs("title")%>" border=0 onClick="MM_openBrWindow('show-work.asp?id=<%=rs("id")%>','','width=740,height=580,scroollbars=yes')"></a>
</td>
</tr>
<tr>
<td height="5"></td>
</tr>
<%
rs.movenext
next
else
response.write "<td>暂无图片</td>"
end if
%> 展开
sql="select * from photo where class1="&cid&" order by id desc"
'response.write sql
Set Rs=Server.CreateObject("adodb.recordSet")
Rs.Open SQl,Conn,3,1
if not rs.eof then
page=Clng(request("page"))
rs.pagesize=9
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.Absolutepage=page
for i=1 to rs.pagesize
if rs.eof then exit for
%>
高手帮帮忙
接上面的
<tr height="10">
<td width="100" height="10" align="left" ><a href="#">
<img width=100 src="administrator/photo/upfile/<%=rs("pictype")%>" alt="<%=rs("title")%>" border=0 onClick="MM_openBrWindow('show-work.asp?id=<%=rs("id")%>','','width=740,height=580,scroollbars=yes')"></a>
</td>
</tr>
<tr>
<td height="5"></td>
</tr>
<%
rs.movenext
next
else
response.write "<td>暂无图片</td>"
end if
%> 展开
展开全部
修改一下, 即可。
<%
sql="select * from news order by createdate desc"
rs.open sql,conn,1,1
if not rs.eof then
%>
<% page=CLng(Request("txtpage"))
rs.PageSize=20
If page<1 Then page=1
If page>rs.PageCount Then page=rs.PageCount
rs.AbsolutePage=page
i=1
%>
<table width="100%" border="0" cellspacing="0">
<tr>
<% do while not rs.eof %>
<td width="448" align="center" ><table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table
width="152" height="112" border="2" cellpadding="0" cellspacing="0" bordercolor="#CECECE" bordercolorlight="#CECECE" bordercolordark="#CECECE">
<tbody>
<tr bordercolor="#ffffff">
<td align="center" bordercolor="#CCCCCC"><a href="product_detail.asp?id=<%=rs("id")%>" target="_blank"><img src="<%=rs("picture0")%>" width="150" height="110" hspace="0" vspace="0"
border="0" /></a></td>
</tr>
</tbody>
</table>
<table width="155" border="0" cellpadding="0" cellspacing="0" bordercolor="#CECECE" >
<tbody>
<tr>
<td height="40" align="center" valign="middle" class="snp2" ><%=rs("title")%></td>
</tr>
</tbody>
</table></td>
<td width="5"> </td>
</tr>
</table>
<% if i mod 5=0 then %>
</td>
<% end if %>
</tr>
<% rs.movenext
i=i+1
if i>rs.pagesize then
exit do
end if
loop
%>
<%
sql="select * from news order by createdate desc"
rs.open sql,conn,1,1
if not rs.eof then
%>
<% page=CLng(Request("txtpage"))
rs.PageSize=20
If page<1 Then page=1
If page>rs.PageCount Then page=rs.PageCount
rs.AbsolutePage=page
i=1
%>
<table width="100%" border="0" cellspacing="0">
<tr>
<% do while not rs.eof %>
<td width="448" align="center" ><table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table
width="152" height="112" border="2" cellpadding="0" cellspacing="0" bordercolor="#CECECE" bordercolorlight="#CECECE" bordercolordark="#CECECE">
<tbody>
<tr bordercolor="#ffffff">
<td align="center" bordercolor="#CCCCCC"><a href="product_detail.asp?id=<%=rs("id")%>" target="_blank"><img src="<%=rs("picture0")%>" width="150" height="110" hspace="0" vspace="0"
border="0" /></a></td>
</tr>
</tbody>
</table>
<table width="155" border="0" cellpadding="0" cellspacing="0" bordercolor="#CECECE" >
<tbody>
<tr>
<td height="40" align="center" valign="middle" class="snp2" ><%=rs("title")%></td>
</tr>
</tbody>
</table></td>
<td width="5"> </td>
</tr>
</table>
<% if i mod 5=0 then %>
</td>
<% end if %>
</tr>
<% rs.movenext
i=i+1
if i>rs.pagesize then
exit do
end if
loop
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询