ahmedsoliman
10-15-2002, 10:25 PM
i have to brows the products in three columns ,so i tybed this code.
----------------------------------------------------------------------------
Set Com=Server.CreateObject("ADODB.Connection")
com.open("shop")
sql1="select prod_id,pname,picture from product where subcat="&subcat_id&""
set rs=com.execute(sql1)
while not rs.eof
%>
<tr>
<td ><A href="productdetail.asp?subcat_id=<%= rs(0) %>"><%= rs(1) %></a></td>
<% rs.movenext %>
<td ><A href="productdetail.asp?subcat_id=<%= rs(0) %>"><%= rs(1) %></a></td>
<% rs.movenext %>
<td ><A href="productdetail.asp?subcat_id=<%= rs(0) %>"><%= rs(1) %></a></td></tr>
<% rs.movenext
wend
%>
-------------------------------------------------------------------------------
but there an error, because if the number of product is 7 or 8 for examble the rs.movenext will act after eof of rs, so i want to exit the wile loop if rs.eof=true
----------------------------------------------------------------------------
Set Com=Server.CreateObject("ADODB.Connection")
com.open("shop")
sql1="select prod_id,pname,picture from product where subcat="&subcat_id&""
set rs=com.execute(sql1)
while not rs.eof
%>
<tr>
<td ><A href="productdetail.asp?subcat_id=<%= rs(0) %>"><%= rs(1) %></a></td>
<% rs.movenext %>
<td ><A href="productdetail.asp?subcat_id=<%= rs(0) %>"><%= rs(1) %></a></td>
<% rs.movenext %>
<td ><A href="productdetail.asp?subcat_id=<%= rs(0) %>"><%= rs(1) %></a></td></tr>
<% rs.movenext
wend
%>
-------------------------------------------------------------------------------
but there an error, because if the number of product is 7 or 8 for examble the rs.movenext will act after eof of rs, so i want to exit the wile loop if rs.eof=true