camdes Posted April 22, 2008 Share Posted April 22, 2008 After much research and hair pulling I have managed to get my photos uploaded, resized and have created thumbnails which are stored in a separate directory. All the required information about the uploaded files including the paths are stored in a Mysql database. My problem now is that when I retrieve all the thumbnails in a category I can only display them in a single column. I would like to display them in 4 or 6 columns with as many rows as required, can someone help a newbie please. Link to comment https://forums.phpfreaks.com/topic/102343-solved-more-photo-gallery-problems/ Share on other sites More sharing options...
jvrothjr Posted April 22, 2008 Share Posted April 22, 2008 Your could use tables. Loop thru that data and every 4th or 6th start another row Link to comment https://forums.phpfreaks.com/topic/102343-solved-more-photo-gallery-problems/#findComment-524109 Share on other sites More sharing options...
camdes Posted April 24, 2008 Author Share Posted April 24, 2008 Worked at it another way but still having problems. The following code is not the one I will be finally using but I am trying to do one step at a time. The table I am showing should have a thumbnail in one column and a link path in another. This is just to show that the SELECT statement is working. The first column does not show the thumbnails and does not even pick up the path while the second column does and the links work. Can anyone help, I seem to have been at this for ever. <?php $SQL = 'SELECT photo_id, photo_thumbnail FROM gallery_photos '; // execute SQL statement $ret = mysql_db_query($dbname,$SQL,$link); $numrows = mysql_num_rows($ret); if (!$ret) { echo( mysql_error()); } else { while ($img = mysql_fetch_array($ret)) { $id = $img[photo_id]; $thumbnail = $img[photo_thumbnail]; $i = $numrows; echo ("<TR>"); echo ('<td> <img src=<?php echo ("$thumbnail");?>> </td>'); echo ("<TD><a href=\"$thumbnail\" target=_blank>$thumbnail</a></TD>\n"); echo ("</TR>"); } echo ("</TABLE>"); } ?> Link to comment https://forums.phpfreaks.com/topic/102343-solved-more-photo-gallery-problems/#findComment-526370 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.