Jump to content

display mediumblob image help


MDanz

Recommended Posts

it's not displaying the image... any help?

 

echo "<img src='advertimage.php?id=$advertid' />"; 

 

advertimage.php

<?php

$id= $_GET['id'];

$thedatabase = new Database2();
$thedatabase->opendb2();

$advert = $thedatabase->viewadvert($id);
header("Content-type: image/jpeg");
  echo $advert;
$thedatabase->closedb2();

?> 

 

 

viewadvert function

function viewadvert($id){
$getadvert = mysql_query("SELECT * FROM `advertise` WHERE `id`='$id' LIMIT 1",$this->connect);

$row=mysql_fetch_assoc($getadvert);

$image = $row['image'];

return $image;

}

 

 

Link to comment
https://forums.phpfreaks.com/topic/237704-display-mediumblob-image-help/
Share on other sites

Does the URL in the <img src="..." have a $advertid value on it?

 

Assuming that you already have php's error_reporting set to E_ALL and display_errors set to ON, temporarily comment out the header() statement in advertimage.php and browse directly to advertimage.php?id=some_valid_id_here and see what you get as output.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.