国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp循環行數輸出函數

2020-07-27 12:58:36
字體:
來源:轉載
供稿:網友
經過大鳥哥的指導已做全面的修改,本人能力有限只能做到下面這步了:

ASP/Visual Basic代碼 
復制代碼 代碼如下:

<%         
Const p=6 '每頁2條         
set rs = server.createobject("adodb.recordset")         
sql = "Select * from show order by id Desc"        
rs.Open sql,conn,1         

i=0        
do while not rs.eof         
%>  <td align="center" height="98">        
    <a href="show.asp?id=<%=rs("id")%>">        
    <img src="<%=rs("pic")%>" width="150" height="98" alt="<%=rs("name")%>" /></a>        
  </td>     
<%     
If (i+1) Mod 3 =0 Then    
 Response.Write "</tr>"    
 If i<(p-1) Then Response.Write "<tr>"    
End If    
i=i+1     
if i>p then exit do     
rs.movenext     
Loop    
If i Mod 3 <>0 Then      
 For m=3-(i Mod 3) To 1 Step -1     
  response.write"<td> </td>"    
 Next    
 response.write"</tr>"    
End If      
If i = 3 Then    
 response.write" <td> </td><td> </td><td> </td></tr>"    
End if     
rs.close     
set rs=nothing     
%>    



之前的代碼未更改 

復制代碼 代碼如下:

<%     
Const p=6 '每頁2條     
set rs = server.createobject("adodb.recordset")     
sql = "Select * from show order by id Desc"    
rs.Open sql,conn,1     

i=1    
do while not rs.eof     
%>  <td align="center" height="98">    
    <a href="show.asp?id=<%=rs("id")%>">    
    <img src="<%=rs("pic")%>" width="150" height="98" alt="<%=rs("name")%>" /></a>    
  </td>    
<%     
if i mod 3 = 0 then     
Response.Write("</tr><tr>")     
end if     
i=i+1     
if i>p then exit do     
rs.movenext     
Loop     
rs.close     
set rs=nothing    
%> 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 芦山县| 小金县| 台北市| 彭阳县| 黔南| 宁城县| 安达市| 阿合奇县| 尼玛县| 峡江县| 饶阳县| 大丰市| 景德镇市| 金湖县| 北川| 文山县| 罗甸县| 墨脱县| 蒲城县| 揭西县| 虞城县| 辽宁省| 香格里拉县| 胶州市| 云南省| 保康县| 长子县| 汝阳县| 商南县| 澄江县| 青铜峡市| 盘山县| 郯城县| 高密市| 来凤县| 海伦市| 绥中县| 永寿县| 阜城县| 白山市| 定陶县|