Thanks for the help.
This is what I ended up with:
<%
Do Until rs_ad_count.EOF
Select Case rs_ad_count.Fields.Item("main_cat_id").Value
Case "1"
clubs_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
Case "2"
accessories_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
Case "3"
apparel_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
Case "4"
instruction_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
Case "5"
equipment_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
Case "6"
travel_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
Case "7"
services_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
Case "8"
real_estate_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
Case "9"
employment_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
Case "10"
general_count = rs_ad_count.Fields.Item("CountOfmain_cat_id").Valu e
End Select
rs_ad_count.MoveNext
Loop
%>
Anthony Jones wrote:
"BaWork" <ba****@sprynet.comwrote in message
news:uP**************@TK2MSFTNGP04.phx.gbl...
>>I have the following data pulled from a db query - it is calculating the
total number of listings for a given category.
CountOfmain_cat_id main_cat_id main_cat
7 1 Clubs
1 2 Accessories
3 3 Apparel
6 4 Instruction
1 5 Course Equipment
2 8 Real Estate
1 9 Employment
1 10 General
I need to display that information on a page, but not it table. I have
an example mocked-up.
http://brettatkin.com/example.gif
Next to each Cat listing, I put the number of ads for that category (5
Ads).
>>How do I make this happen, take the data from the rs and put it next to
each Category heading?
I need to assign the value of CountOfmain_cat_id to a variable for each
row so that I can reference that variable in the HTML next to each cat
heading.
I'm stuck... Any ideas?
<table>
<tr><td>
<%
Dim i : i = 0
Do Until rs.EOF
'Place code and markup to render contents here
rs.MoveNext
If Not rs.EOF Then
If (i Mod 2) = 0 Then
Response.Write "</td><td>"
Else
Response.Write "</td></tr><td>"
End If
End If
i = i + 1
Loop
%>
</td></tr>
</table>
>>Thanks.
Brett