Hello all,
I have a table that has data about the t-shirts i sell. My goal is to display the colors that are available in a specific way on my asp page:
Shirt
I have been playing around for hours with this and need a 2nd opinion.
I am using the following query to get the data:
And the following to display it:
The problem is that not all colors are available in youth as seen in this image:

What i am trying to accomplish is pulling distinct colors and if it has youth sizes then display in red. If it dose not have youth sizes the display in black.
I hope i have explained enough... if not i can supply more info.
Thanks in advance
I have a table that has data about the t-shirts i sell. My goal is to display the colors that are available in a specific way on my asp page:
Shirt
I have been playing around for hours with this and need a 2nd opinion.
I am using the following query to get the data:
Code:
set color2RecordSet = Server.createObject("ADODB.RecordSet") color2Query = "SELECT DISTINCT product_shirts_colors_sizes.color, product_shirts_colors_sizes.hex, product_shirts_colors_sizes.size, product_shirts_colors_sizes.size FROM product_shirts_colors_sizes WHERE (((product_shirts_colors_sizes.size)='Youth Large' Or (product_shirts_colors_sizes.size)='Adult Large') AND ((product_shirts_colors_sizes.product_id)=" & Request.QueryString("product_id") & "))" color2RecordSet.Open color2Query, dbConn, adOpenStatic, adLockReadOnly, adCmdText
Code:
<% while not color2RecordSet.EOF %> <% if color2RecordSet.fields("size") = "Youth Large" then %> <div style="padding:2px; padding-left:20px; height:30px; width:180px"> <div style="height:30px; width:30px; float:left; background-color:#<%= color2RecordSet.fields("hex")%>"></div> <div style="height:25px; padding-left:10px; padding-top:5px; float:right; width:140px; color:#FF0000" ><%= color2RecordSet.fields("color")%></div> </div> <% else %> <div style="padding:2px; padding-left:20px; height:30px; width:180px"> <div style="height:30px; width:30px; float:left; background-color:#<%= color2RecordSet.fields("hex")%>"></div> <div style="height:25px; padding-left:10px; padding-top:5px; float:right; width:140px" ><%= color2RecordSet.fields("color")%></div> </div> <% end if%> <% color2RecordSet.movenext %> <% wend %>

What i am trying to accomplish is pulling distinct colors and if it has youth sizes then display in red. If it dose not have youth sizes the display in black.
I hope i have explained enough... if not i can supply more info.
Thanks in advance
Comment