[高手请教]asp代码查询access只能显示一张图片
麻烦高手帮我看一下。我是刚学ASP的。在网上下载了一个交友程序,我改他一段代码。我想让他显示十张图片,select top 10 可是不知道为什么,只显示一张。麻烦大家帮我看一下。。谢啦 。<marquee scrollamount=1 scrolldelay=73 valign=middle behavior="scroll">
<table height="200" border="0" cellpadding="5" cellspacing="1">
<tr>
<td align="center" valign="top" background="images/bg2.gif">
<%
Set rs_girl = Server.CreateObject("ADODB.Recordset")
sql="select top 10 user_id,netname,age,home from larchives where photo > 0 "
rs_girl.open sql,conn,1,1
if rs_girl.eof and rs_girl.bof then%>
<p>没有,暂时空缺!
<%else
Set rs_pic = Server.CreateObject("ADODB.Recordset")
sql="select id from pic where user_id=" & rs_girl("user_id") & " and index = true"
rs_pic.open sql,connpic,1,1
if rs_pic.eof and rs_pic.bof then
pics=1
else
pics=rs_pic("id")
end if
%>
<table border="0" cellspacing="0" cellpadding="3" style="border-collapse: collapse">
<tr>
<td width="90" valign="top"><div align="center"><a href="read.asp?user_id=<%=rs_girl("user_id")%>"><img border="0" src="display.asp?id=<%=pics%>" width="75" height="100" alt="查看详细资料"></a></div></td>
</tr>
<tr>
<td width="90"><font color="#000000"><%=rs_girl("netname")%><img src="images/v2_line.gif" width="90" height="1"><br>
年龄:<%=rs_girl("age")%><img src="images/v2_line.gif" width="90" height="1"><br>
城市:<%=rs_girl("home")%></font></td>
</tr>
</table>
<%rs_girl.close:set rs_girl=nothing%>
<%end if%></td>
</tr>
</table>
</marquee>
[此贴子已经被作者于2007-5-31 15:56:29编辑过]