我用天源的这个建站系统,产品展示这个模块调用的产品图片要重复的显示两次。检查数据库没有重复记录啊,代码我看了看也没有问题,请教高手了。这个问题困扰我好几天了,一直找不到问题所在。多谢各位了
下面是我的代码
<p>
<%
Set rs = server.CreateObject("adodb.recordset")
exec = "select top 9 * from [products] where recommendatory order by id desc"
rs.Open exec, conn, 1, 1
Do While Not rs.EOF
%>
<blockquote>
</p>
</blockquote>
<ul>
<li><a href="products_view.asp?id=<%=rs("id")%>" title="<%=rs("title")%>"><img src="<%=rs("thumbnail")%>" width="118" height="90" /></a><br />
<a href="products_view.asp?id=<%=rs("id")%>" title="<%=rs("title")%>"><%=left(rs("title"),40)%></a></li>
</ul>
<blockquote>
<p>
<%
rs.movenext
Loop
%>
</p>
<blockquote>
</p>
</blockquote>
<ul>
<%
Set rs = server.CreateObject("adodb.recordset")
exec = "select top 9 * from [products] where recommendatory order by id desc"
rs.Open exec, conn, 1, 1
Do While Not rs.EOF
%>
<li><a href="products_view.asp?id=<%=rs("id")%>" title="<%=rs("title")%>"><img src="<%=rs("thumbnail")%>" width="118" height="90" /></a><br />
<a href="products_view.asp?id=<%=rs("id")%>" title="<%=rs("title")%>"><%=left(rs("title"),40)%></a></li>
<%
rs.movenext
Loop
%>
</ul>
<blockquote>
<p>
</p>
试试
<%
Set rs = server.CreateObject("adodb.recordset")
exec = "select top 9 * from [products] where recommendatory order by id desc"
rs.Open exec, conn, 1, 1
i = 1
Do While Not rs.EOF
%>
<blockquote>
</p>
</blockquote>
<ul>
<li><a href="products_view.asp?id=<%=rs("id")%>" title="<%=rs("title")%>"><img src="<%=rs("thumbnail")%>" width="118" height="90" /></a><br />
<a href="products_view.asp?id=<%=rs("id")%>" title="<%=rs("title")%>"><%=left(rs("title"),40)%></a></li>
</ul>
<blockquote>
<p>
<%
rs.movenext
i = i + 1
Loop
%>
</p>