Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
-
Catz
- Forum Newbie
- Posts: 8
- Joined: Wed Dec 15, 2004 4:08 pm
Post
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.
-
feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Post
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.