It still doesn't work, I am not sure if I am retrieving the blob correctly or not. This is what I have changed the img src in the "view.php" file to:
// 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)) {
$pid = $row['pic_id'];
// 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">
[B] <a href="graphics.php?id=' . $i . '&view=' . $pid . '">
<img src="pic.php?view=' . $pid . '" alt="' . $row['name'] . '" width="130px" /><br /></a>
[/B] </div>
';
} // end of while loop
and this is what I have in the "pic.php" file:
<?php
include ('inc/connect.php');
$query = "SELECT content FROM upload WHERE pic_id = '$pid'";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$content = $row['content'];
header('Content-Type: image/jpeg');
echo $content;
?>
I want to show all of the images in the table, so how do I get this to work?
SELECT content FROM upload WHERE pic_id = '$pid'