请帮忙看看啊!!错在哪里(ASP)

来源:百度知道 编辑:UC知道 时间:2024/05/06 08:18:30
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="14%"><div align="center">星期一</div></td>
<td width="86%">
<%set rs=server.createobject("adodb.recordset")
sql="select top 7 * from kc where datea='星期一' order by px desc"
rs.open sql,conn,1,3
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="daohanglan">
<% do while not rs.eof %>
<tr>
<td width="19%" height="26" nowrap="nowrap"><div align="center"><%=rs("timea")%></div></td>
<td width="39%" nowrap="nowrap"><div align="center"><%=rs("kc&q

id=request("spid")
set rs3=server.CreateObject("adodb.recordset")
strsql= "select * from kc where datea='星期一' and id=id"
里面 id 每次循环都是一样的,因此指向的都是同一条记录
所以<%=rs3("ucount")%> 输出的都是一样的。
如果要想不一样,为什么不直接用 rs("ucount") 呢 引用rs3的作用是什么?

满足rs是所有“星期一”的记录,满足rs3是“星期一”并且满足提交id的一条记录。
你希望是输出多条记录,还是一条记录?