I understand the debate over whether to store images in the database but I'm stuck with this design for now. I also know that this topic has been covered a thousand times in terms of pulling the MySQL BLOB into a separate php file for display purposes. My question is a little more narrow and I haven't seen it anywhere.
I am looping image results from my database into an HTML table that shows the file description and upload date. All I want is the file description hyperlinked so when my users click on it the actual image is displayed. I have this working fine in another script where they choose the image from a dropdown and it POSTS the information to another script. For some reason I am wrapped around the axle on how to display the image from a simple hyperlink. I am trying to do this but it displays all the BLOB data on the page. Can someone point me in the right direction on this one?
while ($row = mysql_fetch_array($answer1)) {
echo '<tr>';
echo "<td><input name='checkbox[]' type='checkbox' id='checkbox[]' value='$row[imageven_id]'></td>";
echo "<td><a href='$row[file_data]')'>$row[upload_name]</a></td>";
echo "<td>$row[image_category]</td>";
echo "<td>$row[upload_date]</td>";
echo '</tr>';
}
codeecho "<td><a href='$row[file_data]')'>$row[upload_name]</a></td>"; To: echo "<td><a href='../php/viewimages.php?id=$row[image_id]')'>$row[upload_name]</a></td>";