nublet Posted January 27, 2009 Share Posted January 27, 2009 Hi i've been trying to make a simple image host with php. I've been having problems with linking the thumbnails to the fullsize images though. Im displaying the thumbnail images with this code <?php include("config.inc.php"); $result = mysql_query("SELECT * FROM gallery_photos"); While($row = mysql_fetch_array($result)){ echo "<img src='photos/tb_" . $row['photo_filename'] . "' />\n"; } ?> When an image is uploaded it is saved to a photos folder as well as a thumbnail version of the image with tb_ at the begining of the file name. File id, date and time are saved into an sql database. Could anyone please help me with this? Link to comment https://forums.phpfreaks.com/topic/142669-linking-thumbnails-to-fullsize-images/ Share on other sites More sharing options...
bluesoul Posted January 27, 2009 Share Posted January 27, 2009 <?php include("config.inc.php"); $result = mysql_query("SELECT * FROM gallery_photos"); While($row = mysql_fetch_array($result)){ echo "<a href='photos/" . $row['photo_filename'] . "'><img src='photos/tb_" . $row['photo_filename'] . "' border='0' /></a><br />"; } ?> Link to comment https://forums.phpfreaks.com/topic/142669-linking-thumbnails-to-fullsize-images/#findComment-747809 Share on other sites More sharing options...
nublet Posted January 27, 2009 Author Share Posted January 27, 2009 Awesome thanks so much for your help Link to comment https://forums.phpfreaks.com/topic/142669-linking-thumbnails-to-fullsize-images/#findComment-747817 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.