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? Quote Link to comment 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 />"; } ?> Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.