新手请教关于论坛显示楼层编号的问题
我把所有主题放在了list这个表里 又把所有回复放在了huifu这个表里面 点开帖子的时候会自动根据主题的ID列出相关的回复内容 但是不知道怎么才能自动显示楼层数,如果用ID显示的话是不对的 请教各位大大!!麻烦了!
2011-04-28 10:55
程序代码:
<%
set rs=server.CreateObject("adodb.recordset")
Set Page = new Cls_Page '创建对象
Set Page.Conn = connr '得到数据库连接对象
With Page
.PageSize = 5 '每页记录条数
.MaxRecord= 0
.PageParm = "p" '页参数
'.PageIndex = 10 '当前页,可选参数,一般是生成静态时需要
.Database = "ac" '数据库类型,AC为access,MSSQL为sqlserver2000存储过程版,MYSQL为mysql,PGSQL为PostGreSql
.Pkey="id" '主键
.Field="id,hfuser,hfsj,hfnr,zid"
.Table="huifu" '表名
.Condition=" zid="&request.QueryString("id")&" " '条件,不需要where
.OrderBy="" '排序,不需要order by,需要asc或者desc
.RecordCount = 0 '总记录数,可以外部赋值,0不保存(适合搜索),-1存为session,-2存为cookies,-3存为applacation
.NumericJump = 3 '数字上下页个数,可选参数,默认为3,负数为跳转个数,0为显示所有
.Template = "共{$RecordCount}条 {$PageSize}条/页 {$PageIndex}/{$PageCount} {$FirstPage} {$PreviousPage} {$NumericPage} {$NextPage} {$LastPage} {$InputPage} {$SelectPage}" '整体模板,可选参数,有默认值
.FirstPage = "首页" '可选参数,有默认值
.PreviousPage = "上一页" '可选参数,有默认值
.NextPage = "下一页" '可选参数,有默认值
.LastPage = "尾页" '可选参数,有默认值
.NumericPage = " {$PageNum} " '数字分页部分模板,可选参数,有默认值
End With
rs = Page.ResultSet() '记录集
'rc = Page.RowCount() '可选,输出总记录数
nav = Page.Nav() '分页样式
If IsNull(rs) Then
Response.Write "<tr><td>暂无记录</td></tr>"
Else
For i=0 To Ubound(rs,2)
%>
<tr><td height="5"></td></tr>
<tr>
<td width="200" height="181" align="left" valign="top" bgcolor="#bdd4ff">
<div class="show_left_user"><%= rs(1,i) %></div>
<div class="show_left_pic">
<img src="images/pic.jpg" width="120" height="130" />
</div>
</td>
<td width="744" align="left" valign="top" bgcolor="#F4F4FF">
<div class="show_right_top">
<div style="float:left; margin-left:10px;">QQ交谈 | 个人中心 | 回复时间:<%= rs(2,i) %></div>
<div style="float:right; margin-right:10px;"> 楼</div>
</div>
<div class="show_right_body"><%= rs(3,i) %></div></td>
</tr>
<%
Next
End If
%>
2011-04-28 10:56
2011-04-28 11:09
2011-04-28 12:13
2011-04-28 17:23
2011-04-29 14:39
2013-02-20 23:29