Page 1 of 1

Resource id #4 Error

Posted: Mon Aug 22, 2005 9:41 am
by Catz
Hi

I'm trying to access a binary image stored in a blob in mySQL, but get the error "Resource id #4 Error"

Code: Select all

<?php
@require("scripts/connect.php");
$iid = $_REQUEST[iid];
$Query = mysql_query("Select image from image where image_id = $iid");
header("Content-type:  image/jpeg");
$result = mysql_fetch_array($Query);
$image = $result["image"];
echo $image;
?>
[/quote]

Any help would be appreciated.

Posted: Mon Aug 22, 2005 9:43 am
by feyd
from where? I'm going to guess the mysql_fetch_array() line? You likely have an error in your query syntax, check what mysql_error() outputs.