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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.