问题描述
- asp页面怎么修改问题?
-
<% sql = "SELECT * FROM Accounts.dbo.view_2 where IsAndroid = 0" set rs = conn.execute(sql) if not rs.eof then do while not rs.eof %> <tr> <td><%=rs("USERID")%></td> <td><%=rs("ACCOUNTS")%></td> </tr> <% rs.movenext loop else %>
上面查询符合条件显示
userid ACCOUNTS NEWS
1 test ?
然后我想在 NEWS获取前面USERID 在执行 SELECT SUM(Score) FROM View_3 where userid = userid 的合计结果 应该要怎么写?
解决方案
重新发一次算了,页面打不开是报错了,不要用ie,ie默认是显示友好http,看不到具体错误,用chrome或者firefox
只有ie的话关闭友好提示,IE HTTP 500网站无法显示该页面
<%
sql = "SELECT * FROM Accounts.dbo.view_2 where IsAndroid = 0"
set rs = conn.execute(sql)
if not rs.eof then
do while not rs.eof
userid=rs("USERID")''''''''''''''''
set rxsum=conn.execute("SELECT SUM(Score) FROM View_3 where userid="&userid)''''''''''''''
score=rssum(0)''''''''''''''''''''''''''
%>
<tr>
<td><%=userid%></td>
<td><%=rs("ACCOUNTS")%></td>
<td><%=score%></td>
</tr>
<%
rs.movenext
loop
else
%>
解决方案二:
<%
sql = "SELECT * FROM Accounts.dbo.view_2 where IsAndroid = 0"
set rs = conn.execute(sql)
if not rs.eof then
do while not rs.eof
userid=rs("USERID")
set rxsum=conn.execute("SELECT SUM(Score) FROM View_3 where userid="&userid)
score=rs(0)
'显示score的代码
%>
<tr>
<td><%=userid%></td>
<td><%=rs("ACCOUNTS")%></td>
</tr>
<%
rs.movenext
loop
else
%>
时间: 2024-12-22 02:12:38