关于函数使用的简单小问题

cwyyoo 2009-07-26 09:57:36
我有现在有个随机函数
<%
Function RndNumber(MaxNum,MinNum)
Randomize
RndNumber=int((MaxNum-MinNum+1)*rnd+MinNum)
RndNumber=RndNumber
End Function
%>

我需要把函数放在以下ASP中使第一行中的VIEW+1变成VIEW+随机

<%
sql = "update postings set views = views + 1 where id = " & id
conn.Execute(sql)
sql = "select title, id, autor, mail, views, replies, datum, datum_updated, message from postings where id = " & id
set rs = conn.Execute(sql)
%>
怎么改.我自己改的没有通过..麻烦高手指点下

<%
DIM SJ
SJ=response.write RndNumber(30,10)
sql = "update postings set views = views + SJ where id = " & id
conn.Execute(sql)
sql = "select title, id, autor, mail, views, replies, datum, datum_updated, message from postings where id = " & id
set rs = conn.Execute(sql)
%>
...全文
55 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2009-07-26
  • 打赏
  • 举报
回复

<%
DIM SJ
SJ = RndNumber(30,10)
response.write SJ
sql = "update postings set views = views + " & SJ & " where id = " & id
conn.Execute(sql)
sql = "select title, id, autor, mail, views, replies, datum, datum_updated, message from postings where id = " & id
set rs = conn.Execute(sql)
%>

wjswshujun 2009-07-26
  • 打赏
  • 举报
回复
"update postings set views = views"& cstr(SJ) & " where id =" & id

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧