Jump to content

php image handling


pritam79
 Share

Recommended Posts

I have a php site. I also have images stored in folders to be displayed in those pages. But i wanted to know how do i store those images in mysql and display them in my php pages by extracting them from mysql database. please give some scripts to display those image from mysql by the help of php script.

Link to comment
Share on other sites

you need to set out a blob column to store the images and have to echo the content with appropiate image header. pulling images from database has some overheads.

Link to comment
Share on other sites

Guest So Called

Use fread() to capture the file into a variable, then addslashes() and store it into a MySQL blob. To display the image just query it out of your database and echo it. Be sure to add the proper headers, particularly Content-Type. You will have to echo the images one at a time from a PHP script. You will not be able to echo them all from one main script mixed with HTML etc.

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
 Share

×
×
  • Create New...