Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7688867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:01:30+00:00 2026-05-31T20:01:30+00:00

I understand the debate over whether to store images in the database but I’m

  • 0

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>';
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:01:31+00:00Added an answer on May 31, 2026 at 8:01 pm

    Storing raw blob data is very complicated if you don’t have image type stored somewhere. I hope you have either fixed the type of image the system accepts or have stored the image type somewhere in the table too.

    Any ways, when you showing images using blob data in a browser, you need to know the image type. Create a separate page to show images only. For example create showimage.php. On this page write the following code

    $id= abs($_GET['id']);
    $query = mysql_query("SELECT file_data FROM imagetable WHERE id='$id'");
    $data=mysql_fetch_array($query);
    
    header('Content-type: image/jpg'); //This is where we need to know the image type
    echo $data['file_data'];
    

    Now, you can link to this page to show the image, in this way

    echo "<a href='showimage.php?id=".$row['id']."'>".$row['upload_name']."</a>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Understand that 1x1 widget size should be 72 dip x 72 dip, but this
I understand this is somewhat trivial but... What the best way to get the
I understand that there's no universal answer to the attribute vs. element debate (and
I understand what System.WeakReference does, but what I can't seem to grasp is a
I'm thinking about implementing Intense Debate in my Wordpress site. I know that ID
I understand these are necessary...of course to write proper code, but is there a
This is just a general question regarding the debate between self-signed certificates and CA
I understand that the CLR needs to do marshaling in some cases, but let's
I understand that to add a path to $LOAD_PATH just do $LOAD_PATH.unshift(path) But I
I understand there is the LogCat view to check the messages logged but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.