抢分题:BOF 或 EOF 中有一个是“真”
一个页面设定显示4个图片,分2行,每行显示2张。现在想加个判断数据库中有无数据,但代码写入后提示错误。现贴出代码,请各位赐教:
<%Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from db_products2 where id_user='"&id&"'"
rs.open sql,conn,1,1%>
.........
<%if rs.eof and rs.bof then
response.Write "暂无图片"
else
number=1
do while not rs.eof and number<=12%>
<table><tr>
<td>
<%if not rs.eof then%>
<img src="<%=rs("img")%>"width="110" height="110" border="0">
<%number=number+1
rs.movenext
end if%>
</td>
<td>
<%if not rs.eof then%>
<img src="<%=rs("img")%>"width="110" height="110" border="0">
<%number=number+1
rs.movenext
end if%>
</td>
</tr></table>
<%loop
end if%>
<%Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from db_products2 where id_user='"&id&"'"
rs.open sql,conn,1,1%>
.........
<%if rs.eof and rs.bof then
response.Write "暂无图片"
else
number=1
do while not rs.eof and number<=12%>
<table><tr>
<td>
<%if not rs.eof then%>
<img src="<%=rs("img")%>"width="110" height="110" border="0">
<%number=number+1
rs.movenext
end if%>
</td>
<td>
<%if not rs.eof then%>
<img src="<%=rs("img")%>"width="110" height="110" border="0">
<%number=number+1
rs.movenext
end if%>
</td>
</tr></table>
<%loop
end if%>
...全文
相关推荐
避障无人机行业分析:2023年全球市场规模大约为447百万美元.docx
避障无人机行业分析:2023年全球市场规模大约为447百万美元.docx
2023五一杯a题无人机完整
2023五一杯a题无人机 完整
基于SWO、COA、LSO、GRO、LO算法(五种2023年最新算法)求解无人机路径规划研究附Matlab代码.docx.rar
基于SWO、COA、LSO、GRO、LO算法(五种2023年最新算法)求解无人机路径规划研究附Matlab代码.docx
基于SWO、COA、LSO、GRO、LO算法(五种2023年最新算法)求解无人机路径规划研究附Matlab代码.docx
基于SWO、COA、LSO、GRO、LO算法(五种2023年最新算法)求解无人机路径规划研究附Matlab代码.docx
激光雷达行业深度研究报告.docx
激光雷达行业深度研究报告.docx


