Page 1 of 1

Display Image in Query

Posted: Wed Oct 07, 2009 8:28 pm
by darren_plehn
What code do you need to allow pictures to come up in a query? This tutorial works perfect, but I need a modification so that I can use a select statement and have all the pictures show.
http://www.phpbuilder.com/columns/florian19991014.php3

Re: Display Image in Query

Posted: Thu Oct 08, 2009 11:11 am
by pickle
Images stored in a database are stored as BLOB columns (or MEDIUMBLOB or LARGEBLOB, etc). Those columns store the raw image data. To get the images stored in the database to display on screen, you need to build a PHP file that you reference from your HTML like you would a regular image. That PHP file loads the image data from the database, sends the appropriate JPG/GIF/PNG/?? headers, then sends the image data - just like a regular image would.