Page 1 of 1
Dispalying JPG images from database
Posted: Sun Oct 27, 2002 10:32 am
by Fari
Hi
I've been struggling

to display an image stored in a 'blob' in a database. Could anyone post a working script for loading into and displaying???
Ta - Frank
Displaying JPG images from database
Posted: Thu Nov 28, 2002 2:46 am
by Slyvampy
The way I did my pictures within my database, was to just put in the location of the image, not the actual image ($location_of_image).
File the image in a directory and in your PHP script output the
$location_of_image as a part of the code example.
within the database:-
+---------------------------------------------------------+-----------------------+
- Location of Image - ALT of Image -
+---------------------------------------------------------+-----------------------+
-
http://www.slyvampy.com/images/image001.jpg - Image Details -
-
http://www.slyvampy.com/images/image002.jpg - Image Details -
+---------------------------------------------------------+-----------------------+
Within the code:-
Code: Select all
<?php
echo "
<IMG SRC=/" $location /" ALT=/" $alt /" BORDER=/"0/"> ";
?>
that way your database size is decreased and you can point the images from anywhere.
Hope this helps,
SteJ.
Posted: Thu Nov 28, 2002 2:52 am
by twigletmac
Try
searching this forum for 'blob AND image AND database' this has been discussed before (IIRC) so you may be able to find how others approached this.
Mac