Skip to main content
Known Participant
August 23, 2010
Question

Recordset image loop

  • August 23, 2010
  • 1 reply
  • 531 views

Hi

I have posted this question before but need some more help.

I have  a number of different products to show on a website each product will have a different number of images.

I need to create a .asp page that would cater for showing all the different images associated with it.

I was told that i would need to create a repeat region that loops through all of the image paths.

Can anybody help me with acheiving this as i do not really know where to start.

some example of code would be good if possible

Thanks

John

This topic has been closed for replies.

1 reply

Inspiring
August 23, 2010

hi,

the complicated way of telling you how to do this would be to "in dreamweaver hilight the images/row of images etc go to the application panel and select server behaviours, then select repeat region"

Or just use the code below:

          <?php do { ?>
          
              <img src="products/<?php echo $row_image_gallery['photo']; ?>" border="0" />

            <?php } while ($row_image_gallery = mysql_fetch_assoc($image_gallery)); ?>

As you can see I am using PHP, I dont think its going to be very different in ASP.

peppsAuthor
Known Participant
August 24, 2010

Hi Thanks for the reply

Am i right in saying douing it the way you suggested would just show one image for each product, if i had 10 products each with 10 images associated with it how would i show all the images associated with that product.

i have a table in the database with a list of products, and then another table with a list of images, the images are linked to the products table via ID but when i do it the way that you suggested it will only show one of the images per product not all of them associated with it.

The repeat region works fine however.

John