PHP: Sub GetListExt(sql_1, sql_2, output_1, output_2, opentag, closetag, row, col) Dim recordcount, pagesize, pagecount, absolutepage, i, j recordcount = conn.Execute(sql_1)(0) If row <= 0 Then row = 1 If col <= 0 Then col = 1 pagesize = row * col If recordcount > 0 Then ' If pagesize = "" Or IsEmpty(pagesize) Or IsNull(pagesize) Then ' pagesize = 30 ' Else ' pagesize = CID(pagesize) ' End If If recordcount Mod pagesize <> 0 Then pagecount = Int(recordcount / pagesize) + 1 Else pagecount = recordcount / pagesize End If absolutepage = CID(Request.QueryString("Page")) If absolutepage = 0 Then absolutepage = 1 If absolutepage > pagecount Then absolutepage = pagecount i = 0 Dim rs, e, s Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql_2, conn, 1, 1 rs.PageSize = pagesize rs.AbsolutePage = absolutepage Do While Not rs.BOF And Not rs.EOF And i < pagesize If i Mod col = 0 Then Response.Write(opentag) j = 0 s = output_1 For Each e In rs.Fields s = Replace(s, "{" & j & "}", NullToSpace(rs.Fields(e.Name))) j = j + 1 Next Response.Write(s) If i Mod col = col - 1 Then Response.Write(closetag & vbCrLf) i = i + 1 rs.MoveNext Loop rs.Close Set rs = Nothing If i Mod col <> 0 Then Do While i Mod col <> 0 s = output_2 Dim k For k = 0 To j s = Replace(s, "{" & k & "}", "") Next Response.Write(s) i = i + 1 Loop Response.Write(closetag & vbCrLf) End If Else Response.Write("<p align=""center"">没有找到满足要求的记录。</p>" & vbCrLf) Exit Sub End If End Sub