Hi,
I'm trying to make a photo gallery that paginates and shows images from a blob database, and each image links to individual pages to view them larger. I uploaded some images to the database, but when I go to view them, all that shows is the box where the image would be, with a link that is the name of the selected image.
I want to show each image in the db above each image name, but can't figure out how to get the correct "img src" of each image.
Here's the block of code I think the problem lies in, in red is the link and img src tag:
// start main content div
echo '<div id="otherpages">';
// Initialize the variable.
$first = TRUE;
// Make the query.
$query = "SELECT pic_id, name FROM upload ORDER BY pic_id DESC LIMIT $start, $display";
$result = @mysql_query ($query); // Run the query.
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
// If this is the first record, create the table header.
if ($first) {
// start the table for images
echo '<table align="center" width="90%" cellspacing="5" cellpadding="3" border="0">
<tr>
<td valign="top" align="center">
';
$first = FALSE; // at least one record has been returned.
} // End of IF.
// Display each record.
echo '<div id="showimg" style="width: 130px; z-index: 5; display:block; text-align: center">
[COLOR="Red"]<a href="graphics.php?pic_id="' . $row['pic_id'] . '&name=' . $row['name'] . '">
<img src="upload/' . $row['pic_id'] . '" alt="' . $row['name'] . '" width="130px" /><br /></a>[/COLOR]
</div>
';
} // end of while loop
if ($first) {
echo '<div id="showimg" style="width: 130px; z-index: 5; overflow: visible; text-align: center">
Sorry, there is no images in the database for this page yet. Please check back later today, as I am still working on uploading and displaying my work examples.
</div>
';
} else {
// close content table
echo '</td>
</tr>
<tr>
<td>
';
}