Hi there,
Had a bit of a problem here. I have a foreach loop to display images for each property (like you get a group of images in an estate agent).
This is based from two tables. Properties and Photos. There is a one to many join from Properties to Photos, so each property can have x amount of images with it.
Noew the problem with displaying each one. This almost works. However I think it needs to say
foreach(Property['PropertiesID'] as $photo){
<?php do { ?>
<div id="thumb">
<img src="images/thumbnails/<?php echo $row_Properties['reference']; ?>/<?php echo $row_Properties['PropertyThumbnail']; ?>" width="140" height="105" alt="<?php echo $row_Properties['PropertyTitle']; ?>" /></div>
</div>
<table>
<tr id="images_row">
<?php $i=0; foreach($row_property_photos = mysql_fetch_assoc($property_photos) as $photo){ ?>
<td>
<img src="images/thumbnails/<?php echo $row_property_photos['reference']; ?>/<?php echo $row_property_photos['PhotoLink']; ?>" width="140" height="105" alt="<?php echo $row_property_photos['PhotoDescription']; ?>" />
</td>
<?php $i++; } ?>
</tr>
</table>
<?php } while ($row_Properties = mysql_fetch_assoc($Properties)); ?>
This displays the first image x amount of times in the array, and so on and so forth.
I would really like for someone to help me with the correct condition here. If anyone is able to help me would be very thankful...
Thanks
Andi