PDA

View Full Version : multiple images


choobakka
03-28-2006, 01:12 PM
i have managed to pull images from my database and display them depending on a users selection from a drop-down list.

however, within my database, i have four products with the same image (they have different product codes because they are different sizes but the images are the same)

i have set a repeat region on the image in dreamweaver and if i open the webpage and select an option i am presnted with four identical images. so i deleted 3 of the image urls from the database but becuase of the repeat region, the ones i deleted still come up on my webpage as red crossses. how can i get rid of them?

davidj
03-28-2006, 01:29 PM
you need to wrap your repeated image vars in an IF

not sure about the asp syntax though

example ......

where you have your dynamic vars in your repeat region just do....

<%

If imagevar != '' Then

place your repeating image var code here

End If
%>

choobakka
03-29-2006, 12:11 PM
ok this is the code for the table where the images are being outputted:

<table width="176" height="85">
<tr>
<th scope="row">
<%
While ((Repeat1__numRows <> 0) AND (NOT rsInventory.EOF))
%>
<% If Not rsInventory.EOF Or Not rsInventory.BOF Then %>
<%=(rsInventory.Fields.Item(">
<% End If ' end Not rsInventory.EOF Or NOT rsInventory.BOF %>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsInventory.MoveNext()
Wend
%></th>
</tr>
</table>

where would i put that code?

davidj
03-29-2006, 12:13 PM
what is the name of your db var that contains the image

choobakka
03-29-2006, 12:18 PM
if u mean the field name in the database for the image url its simply 'image'