in index.php I have the code:
<img src="image-get.php?id=1" border="0">
and image-get.php has the code
<?php
if($image_id) {
// Database connection //
@mysql_connect("localhost","xxx","yyy") or die ("Can not connect to given host");
@mysql_select_db("zzz") or die ("Can not connect to database");
$query = @mysql_query("select image, type from imagini where id=$image_id");
$image = @mysql_result($query,0,"image");
$type = @mysql_result($query,0,"type");
Header( "Content-type: $type");
echo $image;
};
?>
I'm able to connect to db but the index.php files returns a red cross square instead of the picture. Any ideas?
problems extracting image from mysql db
Moderator: General Moderators
images in MzSQL
As I see You put your images in BLOB? right?
Just put URL address in table, and use it as:
<img src ='$Photo_url' width='$Foto_W'....>
Just put URL address in table, and use it as:
<img src ='$Photo_url' width='$Foto_W'....>