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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.