ASP中二维数组赋值和输出来 SQL调用

<%dimsql,rs,a(12,2)setrs=Server.CreateObject("ADODB.RecordSet")sql="selecta.content,a... <%
dim sql, rs, a(12,2)
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select a.content,a.pxid,a.title,a.picurl,a.isrec,a.sortid,b.enpxname,a.dateandtime from hyxx a inner join hyxx_class1 b on a.sortid=b.pxid where a.isrec=1 and a.sortid in(select pxid from hyxx_class1 where enpxname in('trend','new york trend','london trend','milan trend','paris trend')) and picurl is not null and ispass=1 order by dateandtime desc"
rs.open sql, conn,1,1
for i = 0 to 12
if not(rs.eof) then
for j = 0 to 2
a(i,0)=rs("picurl")
a(i,1)=rs("content")
a(i,2)=rs("title")
next
rs.movenext
end if
next
rs.close
set rs = nothing%>
<div class="left_5_bg">
<div class="left_5_photo_bg">
<div class="left_5_lphoto"></div>
<div class="left_5_photo_zs_bg">
<div class="left_5_photo_zs_bg_bg">
<div class="left_5_photo_zs_bg_bg_1"><a href="#"><img src="../<%=a(i,0)%>" alt="<%=a(i,1)%>" width="97px" height="135px" /><span><%=a(i,2)%></span></a></div>
<div class="left_5_photo_zs_bg_bg_1"><a href="#" target="_blank"><img src="../<%=a(i,0)%>" width="97px" height="135px" /><span><%=left(cleanword(a(i,2)),10)%></span></a></div>
<div class="left_5_photo_zs_bg_bg_1"><a href="#" target="_blank"><img src="../<%=a(i,0)%>" width="97px" height="135px" /><span><%=left(cleanword(a(i,2)),10)%></span></a></div>
<div class="left_5_photo_zs_bg_bg_1"><a href="#" target="_blank"><img src="../<%=a(i,0)%>" width="97px" height="135px" /><span><%=left(cleanword(a(i,2)),10)%></span></a></div>
</div>

我换个号给你分吧 可以的话帮我解决下吧! 我真的不会什么循环 就详细
展开
 我来答
缓步莫迟疑C
2012-04-03 · TA获得超过1.1万个赞
知道大有可为答主
回答量:6217
采纳率:73%
帮助的人:6706万
展开全部
<div class="left_5_photo_zs_bg_bg"><%
For i = 0 To 12%>
<div class="left_5_photo_zs_bg_bg_1"><a href="#" target="_blank"><img src="../<%=a(i,0)%>" width="97px" height="135px" /><span><%=left(cleanword(a(i,2)),10)%></span></a></div><%
Next%>
</div>
这样就可以了.

for j = 0 to 2
a(i,0)=rs("picurl")
a(i,1)=rs("content")
a(i,2)=rs("title")
next
这段代码,如果你直接用字段名,就可以不用这个循环了,直接写成
a(i,0)=rs("picurl")
a(i,1)=rs("content")
a(i,2)=rs("title")
就可以了.
更多追问追答
追问
可以完整点吗?我连放在什么位置都不知道  绝对新手  谢谢
追答


" width="97px" height="135px" />
来自:求助得到的回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式