Problem Showing Images Stored in DB

Submitted by mostafa581 on
friends I'm facing a problem with showing images stored into my database according to the following. I'm building a news website which shows news and a pic related to each news. I could make a page by which I can store news and a picture with each one. I made this page which show these news as a title and a pic beside each news title. everything is ok but these pics can't be shown all i can see is a red X mark in the place of the pic although i right click on the red X and saw that the source of the pic is ok with the ip of each pic. I'm posting the code i did so anyone could tell me what is wrong or missing with it. I created a page called getimage.php and here is the code of it
  1. <?php
  2.  include ("config.php");
  3. // this is to get the id of the required pic
  4.  $id=addslashes(@$_REQUEST['id']);
  5.         $image= mysql_query ("SELECT photo FROM tourism_news Where id=$id");
  6.         $row1 = mysql_fetch_assoc($image);
  7.         $myimage= $row1['photo'];
  8.        
  9.         header("content-type:image/jpeg");
  10.         //$type ='content-type:'.$row1['imagetype'];
  11.           $type ="content-type:".$row1['imagetype'];  
  12.    echo "<img src='$myimage' width='100' height='200'>";
  13.     //header($type);
  14.         //echo  $row1['photo'];
  15.         echo "$myimage";
  16.         //echo <img src=\"$myimage\">;
  17. ?>
as for the page which show these pics the code of that part which shows the picture is as followiing
  1. echo"<img src='getimage.php?id=".$row['id']."' width=200 height=140 />";
i tried alot with this code but it did not work with me as a beginner and this is my first site so i,m waiting for your point of view my dear friends. Thank you