I am working on a site that needs to display inventory data. I am using these fields in my table (Product_Name, Product_Type, Product_Price, Product_Image). I am able to get all of this info uploaded via PHP (I am storing the images in a folder and not in the database via BLOB). I can get it to display the first 3 columns (Name, Type, Price). I can’t get it to display the image. I have read that I cannot display binary data as well as other field types because of the header declaration. I know how to do the thumbnail with PHP. I want the thumbnail to be clickable with a lightbox type deal showing the full size image.
I had a screenshot to show what I am trying to do, but I am not able to because I am new to this site.
I have found numerous tuts on how to upload files, how to display images from either a folder or a BLOB, but I have not found an answer to what I am trying to do.
Is it even possible through PHP to do a SELECT * from table and display all fields in a table, including a thumbnail which is clickable to display full size image.
I am hoping that someone can point me in the right direction, either a tutorial or someone who could show me some sample code.
Thanks!
How are you storing the image info in your database? A link? Something else? To display the image, output the link location via MySQL and output it on the page. You’ll need to use a lightbox library to display it in a lightbox pop-up window.
ie…
in your table you have:
On your page use something like:
You’ll need to define
$imagesomewhere after you connect to you db.