in reply to Re^3: blob output
in thread blob output

i selected the photo from table

my $pic = $DBH->prepare("SELECT PHOTO FROM tble WHERE ID = ?"); $pic->execute(#ID); $pik = $pic->fetchrow;

this is my html div where i want to display the img

html <img src="$pik">

this is the output. the photo i got from table where is blob column

u can see the photo was selected successful from table and brings the photo name exactly. bt the problem it doesn;t display to browser

output <img src="02100.JPG" #this is the photo i got from db. bt cant display +>

Replies are listed 'Best First'.
Re^5: blob output
by marto (Cardinal) on Sep 11, 2018 at 08:43 UTC

    This isn't how it works. 02100.JPG isn't the image data, that's the name of the image. If all you have stored in the database is the filename all your photos will have to be in the same directory as the page being served. Otherwise you'll have to prepend the correct path to this variable. This clearly isn't doing what you seem to think it does. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img.

      yah i got u. maybe i never stored binary data instead stored only photo name

      let me fix and see

        yah n pm not twtr u cn uz complete words and sentences!


        Give a man a fish:  <%-{-{-{-<