Forums

ASP

This topic is locked

Select Statement filter

Posted 18 Jul 2003 05:06:55
1
has voted
18 Jul 2003 05:06:55 Buddy Quaid posted:
Hi there:

I have a page right now that is included into the index.asp through an IF THEN statement inside the index.asp page. It displays the categories and genders of products correctly for the right category.

Here is the code from the page that works:
=======================
<%
gender=0
Do While not rsQuery.EOF
currentcategory = rsQuery("category"
%>
<%
Do While ( rsQuery("Category" = currentcategory )
currentsubcategory = rsQuery("gender"
gender=gender+1
%> <h5 class="genderTitle"><%=rsQuery("gender"%></h5>
<%
Do While ( rsQuery("gender" = currentsubcategory )
%>
<FONT face="Arial" size=1 color=#cc0000><b><font color="#FF8040">></font></b></font><A href="index.asp?itemid=<%=rsQuery("productID"%>" class="generaltxt"><%=rsQuery("productName"%></A>
==========================
Fine!

But i've redone the page to have thumbnails of pictures and repeat region. So here is the code from that page:
==========================
<%
While ((startrw <= endrw) AND (Not rsQuery.EOF))
%>
<td> <table width="100" border="0">
<tr>
<td><div align="center"> <A href="index2.asp?itemid=<%=rsQuery("productID"%>">
</a>
<A href="index2.asp?itemid=<%=rsQuery("productID"%>"><img src="../large/<%=(rsQuery("pictureFile".Value)%>" width=100 height=100></a></div></td>
</tr>
<tr>
<td><div align="center"><span class="productName"><%=(rsQuery("productName".Value)%></span><br>
<span class="prodPrice"><%=formatCurrency(rsQuery("price".Value)%></span></div></td>
</tr>
</table></td>
<%
startrw = startrw + 1
rsQuery.MoveNext()
Wend
%>
===========================
The problem is I need to incorporate the code from the first block of code to the block of code above. The block of code above shows ALL the products and does NOT filter the "category". I know I could do this from the SQL statement but it works just fine from the block of code that works but i'm afraid I put things in the wrong places since it deals with creating the tables and stuff and also has that little bit of code at the bottom with the 'Wend'.

I hope I explained this alright.

Buddy

Reply to this topic