PHP Gallery
Posted: Mon Feb 16, 2009 7:30 pm
Hey, Im making a gallery which gets file paths from a database and loads images depending on the PhotoAlbum row by getting the value from the URL, all of that works fine, the problem I have is showing the images in the correct way. I want there to be 3 images per row, each different, but at the moment it is showing 3 of the same image per row on 3 rows (See Attached File, I have also attached how it looks in Dreamweaver)
Here is the code for 1 row:
I've Shortened it to 1 row because there is an awful lot of repetition.
$images code:
Here is the code for 1 row:
Code: Select all
<?php do { ?><tr>
<td width="161" height="136" bgcolor="#b3b3b3"><div align="center"><a href="..<?php echo $row_images['photoFilePath']; ?><?php echo $row_images['PhotoAlbum']; ?>/<?php echo $row_images['photoName']; ?>.jpg" rel="lightbox"><img src="..<?php echo $row_images['photoFilePath']; ?><?php echo $row_images['PhotoAlbum']; ?>/<?php echo $row_images['photoName']; ?>.jpg" width="130" height="87" /></a></div></td>
<td width="161" bgcolor="#b3b3b3"><div align="center"><a href="..<?php echo $row_images['photoFilePath']; ?><?php echo $row_images['PhotoAlbum']; ?>/<?php echo $row_images['photoName']; ?>.jpg" rel="lightbox"><img src="..<?php echo $row_images['photoFilePath']; ?><?php echo $row_images['PhotoAlbum']; ?>/<?php echo $row_images['photoName']; ?>.jpg" alt="" width="130" height="87" /></a></div></td>
<td width="161" bgcolor="#b3b3b3"><div align="center"><a href="..<?php echo $row_images['photoFilePath']; ?><?php echo $row_images['PhotoAlbum']; ?>/<?php echo $row_images['photoName']; ?>.jpg" rel="lightbox"><img src="..<?php echo $row_images['photoFilePath']; ?><?php echo $row_images['PhotoAlbum']; ?>/<?php echo $row_images['photoName']; ?>.jpg" alt="" width="130" height="87" /></a></div></td>
</tr><?php } while ($row_images = mysql_fetch_assoc($images)); ?>$images code:
Code: Select all
mysql_select_db($database_localhost, $localhost);
$query_images = "SELECT * FROM images WHERE (PhotoAlbum ='{$colname_get}')";
$query_limit_images = sprintf("%s LIMIT %d, %d", $query_images, $startRow_images, $maxRows_images);
$images = mysql_query($query_limit_images, $localhost) or die(mysql_error());