<!--#include file="conn.asp"-->
javastr=""
<%
dim visiter
dim count1
dim count2
dim count3
dim count4
dim count5
dim count6
dim count7
dim sql
dim rs
sql="select visiter from visiter1"
set rs=conn.execute(sql)
count1=rs("visiter")
rs.close
sql="select visiter from visiter2"
set rs=conn.execute(sql)
count2=rs("visiter")
rs.close
sql="select visiter from visiter3"
set rs=conn.execute(sql)
count3=rs("visiter")
rs.close
sql="select visiter from visiter4"
set rs=conn.execute(sql)
count4=rs("visiter")
rs.close
sql="select visiter from visiter5"
set rs=conn.execute(sql)
count5=rs("visiter")
rs.close
sql="select visiter from visiter6"
set rs=conn.execute(sql)
count6=rs("visiter")
rs.close
sql="select visiter from visiter7"
set rs=conn.execute(sql)
count7=rs("visiter")
rs.close
count=count1+count2+count3+count4+count5+count6+count7
changdu=len(count)
for i=1 to 8-changdu
%>
javastr=javastr+"<img src='count/imagesjsq/0.gif' border=0></img>"
<%
next
for i=1 to changdu
%>
javastr=javastr+"<img src='count/imagesjsq/<%=mid(count,i,1)%>.gif' border=0></img>"
<%
next
%>
document.write ("<a title='网站访问量计数器
总访问量:<%=count%>'>");
document.write (javastr);
document.write ("</a>");
<%
sql="update visiter set visiter="&count
rs.close
set rs=nothing
conn.execute(sql)
conn.close
set conn=nothing
%>
上面是我做的一个统计总访问量的程序
数据库中有七个表,从visiter1,visiter2……到visiter7,用来存放七天的访问量,每个表的结构相同,字段visiter都是存放每天访问量的,这段程序我想实现的是统计总访问量,可是不显示数字,怎么解决?