Jump to content

displaying thumbnails... what am I missing?


jamesv

Recommended Posts

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>';

}

?>

 

Link to comment
https://forums.phpfreaks.com/topic/162184-displaying-thumbnails-what-am-i-missing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.