can't display image from database

Discussion in 'PHP and MySQL' started by stelios, Jan 29, 2012.

  1. stelios

    stelios Guppy


    I have uploaded some pictures in my database, but when I retrieve them they are not displayed. The rest of the information is well appeared.

    This is my image.php file:

    include ('dbconnect.php');
    $db connect();
    $stmt $db->query('select name,type,content from upload where id='.$id);
    $stmt as $row)
    $row['name'].' '.$row['type'];
    $imagebytes $row['content'];

    header("Content-type: "$row['type']);



    and then in my html i call it by:
    <img src="image.php?id=1">

    Where is my mistake? Thanks in advance
  2. linda martin

    linda martin Guppy

    The image link is wrong.You will change the link and connect the database.You retrieve the program and then execute.

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services