注册 登录
编程论坛 新人交流区

[求助] 请问!我这段asp代码怎样改呢?

jsr 发布于 2007-10-18 01:41, 246 次点击

<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select student.sid,student.cla_id,student.suser,student.sname,bbs.bresult,bbs.sub_id,bbs.buser from student,bbs where bbs.buser=student.suser"
rs.Open sql,conn,1,1

if rs.EOF and rs.BOF then
response.write "数据库没有记录!"
response.end
else
%>
……
<%
do while not rs.eof
%>
……
<td><% if rs("sub_id")=1 then '1为语文科ID %><div align="left">&nbsp;<%=rs("bresult")%></div><% end if %></td>
<td><% if rs("sub_id")=2 then '2为数学科ID %><div align="left">&nbsp;<%=rs("bresult")%></div><% end if %></td>
……

为何输出这样(不在同一行上显示同一人的成绩,数据库中所有的成绩是记录在同一字段上的):
姓名 语文 数学
李四 88
99
我想要的效果是:
姓名 语文 数学
李四 88 99

谁能帮我指点一下,如何改,请具体一些!没人像我这么菜了!

[此贴子已经被作者于2007-10-18 2:07:40编辑过]

2 回复
#2
jsr2007-10-18 13:48
自己顶一下!
#3
jsr2007-10-18 19:21
再顶!看看有没有人肯帮助!
1