ASP如何增加点击数
<tablewidth="433"height="36"border="0"cellpadding="0"cellspacing="0"><tr><tdwidth="91...
<table width="433" height="36" border="0" cellpadding="0" cellspacing="0 ">
<tr>
<td width="91">ID</td>
<td width="101">标题</td>
<td width="158">时间</td>
<td width="83">点击数</td>
</tr>
<tr>
<%
for i= 1 to rs.pagesize
if rs.eof then
exit for
end if
%>
<td>
<%=rs("ID")%>
</td>
<td><a href="disp.asp?id=<%=rs("id")%>"><%=rs("title")%></a></td>
<td>
<%=rs("time")%>
</td>
<td>
<%=rs("hits")%>
</td><%
rs.movenext
next
%>
</tr>
<br>
</table>
我不知道如何让hits显示增加数 请指教 展开
<tr>
<td width="91">ID</td>
<td width="101">标题</td>
<td width="158">时间</td>
<td width="83">点击数</td>
</tr>
<tr>
<%
for i= 1 to rs.pagesize
if rs.eof then
exit for
end if
%>
<td>
<%=rs("ID")%>
</td>
<td><a href="disp.asp?id=<%=rs("id")%>"><%=rs("title")%></a></td>
<td>
<%=rs("time")%>
</td>
<td>
<%=rs("hits")%>
</td><%
rs.movenext
next
%>
</tr>
<br>
</table>
我不知道如何让hits显示增加数 请指教 展开
2个回答
展开全部
给你量身订做的,保障正确
<!--#include file "conn.asp"-->
<%set rs=server.createobject("adodb.recordset")
sql="select * from 表 where id ="&trim(request.querystring("id"))
sql1="update 表 set hits=hits+1 where id="&trim(request.querystring("id"))
conn.execute(sql1)
rs.open sql,conn,1,1
%>
<html>
<head>
<title><%=rs("title")%></title>
</head>
<body>
<table width="433" height="36" border="0" cellpadding="0" cellspacing="0 ">
<tr>
<td width="91">ID</td>
<td width="101">标题</td>
<td width="158">时间</td>
<td width="83">点击数</td>
</tr>
<tr>
<%
for i= 1 to rs.pagesize
if rs.eof then
exit for
end if
%>
<td>
<%=rs("ID")%>
</td>
<td><a href="disp.asp?id=<%=rs("id")%>"><%=rs("title")%></a></td>
<td>
<%=rs("time")%>
</td>
<td>
<%=rs("hits")%>
</td><%
rs.movenext
next
%>
</tr>
<br>
</table>
</body>
</html>
<%rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<!--#include file "conn.asp"-->
<%set rs=server.createobject("adodb.recordset")
sql="select * from 表 where id ="&trim(request.querystring("id"))
sql1="update 表 set hits=hits+1 where id="&trim(request.querystring("id"))
conn.execute(sql1)
rs.open sql,conn,1,1
%>
<html>
<head>
<title><%=rs("title")%></title>
</head>
<body>
<table width="433" height="36" border="0" cellpadding="0" cellspacing="0 ">
<tr>
<td width="91">ID</td>
<td width="101">标题</td>
<td width="158">时间</td>
<td width="83">点击数</td>
</tr>
<tr>
<%
for i= 1 to rs.pagesize
if rs.eof then
exit for
end if
%>
<td>
<%=rs("ID")%>
</td>
<td><a href="disp.asp?id=<%=rs("id")%>"><%=rs("title")%></a></td>
<td>
<%=rs("time")%>
</td>
<td>
<%=rs("hits")%>
</td><%
rs.movenext
next
%>
</tr>
<br>
</table>
</body>
</html>
<%rs.close
set rs=nothing
conn.close
set conn=nothing
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询