Jump to content

Bringing images through database


lillizzierae

Recommended Posts

The same way you get any other data, with a select statement. The difference is how you display the data, you can't just print out binary image data to see the image. First you need to send the browser a content-type header that says what kind of data it is (what kind of image), and then you can print the data from the database. The browser will see the content-type header and interpret the following data as the data for that image.When you store an image in the database, the data you want to store is the data you get by using fread or file_get_contents on the image file.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...