请先登录 | 注册
MYCSG.CN
请教 - 文章首页返回版区
■标题:请教
■作者:savage [2004/3/23 13:23:28]
请教高手,假如我的论坛id为1,下属论坛为id2、3、4,如何在以下代码里把id=1 的主题数改为2、3、4的总和?
谢谢了!
<table width="97%" align="center" border="0" class="a2" cellspacing=1 cellpadding=0><%
if Request.Cookies("forumid")<>empty then
sql="select * from bbsconfig where id="&Request.Cookies("forumid")&" and hide=1"
Set Rs=Conn.Execute(sql)
if not Rs.eof then
if ""&Rs("password")&""="" then:password=0:else:password=1:end if
%><script>ShowList("<%=Rs("pass")%>","<%=Rs("id")%>","<%=Rs("bbsname")%>","<%=Rs("icon")%>","<%=Rs("intro")%>","<%=Rs("moderated")%>","<%=Rs("today")%>","<%=Rs("toltopic")%>","<%=Rs("tolrestore")%>","<%=Rs("lasttime")%>","<%=Rs("lastname")%>","<%=Rs("lasttopic")%>","<%=password%>");</script>
<%
end if
Rs.close
end if
ForumList(0)
%> </table>

回复/版区/上篇/下篇/发贴/仅文字/HTML
【倒序/最近21条回复】
■作者:savage [2004/3/26 21:38:14]
同意区长,但是没提示错误就是不能显示为总和
我也不知道是什么问题


■作者:IPSC [2004/3/26 18:54:29]
有什么提示嘛,就给我一句“不行”,我怎么知道哪儿出问题?很多东西不是一挥而就的。


■作者:savage [2004/3/24 20:24:07]
还是不行。

■作者:IPSC [2004/3/24 19:08:30]
上面我提供的代码修改了一下,你再试试看,再不行只有等我在的时候上QQ在线帮你改了。

■作者:琴琴 [2004/3/24 16:12:41]


■作者:savage [2004/3/24 15:15:17]
还是不行,调用不出来,如果可以,希望把主题、帖子数、今日帖子都调用出来

■作者:IPSC [2004/3/23 22:45:40]
<table width="97%" align="center" border="0" class="a2" cellspacing=1 cellpadding=0><%
if Request.Cookies("forumid")<>empty then
sql="select * from bbsconfig where id="&Request.Cookies("forumid")&" and hide=1"
Set Rs=Conn.Execute(sql)
if not Rs.eof then
if ""&Rs("password")&""="" then:password=0:else:password=1:end if

'==========下面为修改的代码
toltopic=rs("toltopic")
if rs("id")=1 then
toltopic2=Conn.Execute("Select toltopic From forum where id=2")(0)
toltopic3=Conn.Execute("Select toltopic From forum where id=3")(0)
toltopic4=Conn.Execute("Select toltopic From forum where id=4")(0)
toltopic=toltopic+toltopic2+toltopic3+toltopic4
end if

%><script>ShowList("<%=Rs("pass")%>","<%=Rs("id")%>","<%=Rs("bbsname")%>","<%=Rs("icon")%>","<%=Rs("intro")%>","<%=Rs("moderated")%>","<%=Rs("today")%>","<%=toltopic%>","<%=Rs("tolrestore")%>","<%=Rs("lasttime")%>","<%=Rs("lastname")%>","<%=Rs("lasttopic")%>","<%=password%>");</script>
<%

'===============End================
end if
Rs.close
end if
ForumList(0)
%> </table>







我现在这台机不能测试,你试试,如果有错一般是这行造成的
toltopic2=Conn.Execute("Select toltopic From forum where id=2")(0)
把后面的id=2")(0)改为id=2)(0)试试,还不行再回复告诉我吧。

[此帖子已被作者在 2004-3-24 13:33:32 编辑过]

[此帖子已被作者在 2004-3-24 19:07:47 编辑过]

(查看完整版网页)



短讯|首页|登录|算法|电脑版 .
DK MiniBBS Plus v2.0
mm0759.com
468 毫秒 .