Jump to content
Sign in to follow this  
pritam79

php image handling

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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...