MDanz Posted January 9, 2011 Share Posted January 9, 2011 it should display the image but nothing appears. what have i done wrong? echo "<img src=\"photo.php?id=$studentid\" alt='photo' />"; photo.php <?php $id= $_GET['id']; $getphoto= mysql_query("SELECT photo FROM Student WHERE SID=$id LIMIT 1"); $row5 = mysql_fetch_assoc($getphoto); $photogot = $row5['PHOTO']; header("Content-type: image/gif"); print $photogot; ?> Link to comment https://forums.phpfreaks.com/topic/223906-display-image-from-blob-not-working/ Share on other sites More sharing options...
MDanz Posted January 9, 2011 Author Share Posted January 9, 2011 i get this error <b>Fatal error</b>: Using $this when not in object context in .. on line 5. line 5 is the query on photo.php Link to comment https://forums.phpfreaks.com/topic/223906-display-image-from-blob-not-working/#findComment-1157171 Share on other sites More sharing options...
BlueSkyIS Posted January 9, 2011 Share Posted January 9, 2011 you're not using $this on that line. i suspect the problem is actually on line 5 in .. (the part of the error message you left out) Link to comment https://forums.phpfreaks.com/topic/223906-display-image-from-blob-not-working/#findComment-1157173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.