Jump to content

Bringing images through database


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...