jamesv Posted June 14, 2009 Share Posted June 14, 2009 Hi guys. Here's something simple, but I'm stumped. I have a page that should display some thumbnail images, which are also links to the full size pictures. The thumbs were created on a different page when the photo was uploaded, and the images and thumbnails are then saved in two different directory folders "/images" and "/images/thumbs" (and yes, the thumbnails were successfully created and saved). When I try to view this gallery page, I get the table with text and line breaks but no images, yet clicking the missing image symbol does pull up the full size image (as you would expect). What am I missing here...? <?php // get the table $query ='SELECT * FROM images'; $result = mysql_query($query, $connection) or die(mysql_error()); $odd = true; while ($rows = mysql_fetch_array($result)) { echo ($odd == true) ? '<tr class="odd_row">' : '<tr class="even_row">'; $odd = !$odd; extract($rows); echo '<td> <a href= "images/' . $image_id . '.jpg">'; echo '<img src = "images/thumbs/'. $image_id . '.jpg">'; echo '</a></td>'; echo '<td>'. $image_caption .'</td>'; echo '<td>'. $image_username .'</td>'; echo '<td>'. $image_date .'</td>'; echo '</tr>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/162184-displaying-thumbnails-what-am-i-missing/ Share on other sites More sharing options...
ohdang888 Posted June 15, 2009 Share Posted June 15, 2009 view the page source to try to debug whats missing Quote Link to comment https://forums.phpfreaks.com/topic/162184-displaying-thumbnails-what-am-i-missing/#findComment-855937 Share on other sites More sharing options...
RussellReal Posted June 15, 2009 Share Posted June 15, 2009 echo '<img src = "images/thumbs/'. $image_id . '.jpg">'; try this echo "<img src='images/thumbs/{$image_id}.jpg' />"; Quote Link to comment https://forums.phpfreaks.com/topic/162184-displaying-thumbnails-what-am-i-missing/#findComment-855939 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.