不能得到blob存储图像到图像格式(MySql和php)


cant able to get the blob stored image into image format(MySql AND php)?

我试图获得在Mysql数据库中存储在blob格式的图像。我使用下面的代码:
index . php

<img src='image.php?questionid=questionid&question=question1&answer=answer1&author=myname' />

image.php

<?php
require_once('dbconfiguration.php');
$sql="SELECT image FROM tablename WHERE questionid='{$_GET['questionid']}' and question='{$_GET['question']}' and answer='{$_GET['answer']}' and author='{$_GET['author']}'";
$STH = $DBH->query($sql);  
$STH->setFetchMode(PDO::FETCH_ASSOC);  
$row = $STH->fetch();  
ob_clean();
header("content-type: image/jpg") ; 
echo $row['image'] ; 
?>

在index.php中我没有得到任何图像。因此,当我输入image.php的URL时,我在forefox中得到以下错误:

The image “URL” cannot be displayed because it contains errors.

我使用的是php5.3和mysql 5.1.36 .

我做错了什么我浏览了几乎所有的论坛,没有任何线索。

应该是:

<?php
require_once('dbconfiguration.php');
$sql="SELECT image FROM tablename WHERE questionid='{$_GET['questionid']}' and question='{$_GET['question']}' and answer='{$_GET['answer']}' and author='{$_GET['author']}'";
$STH = $DBH->query($sql);  
$STH->setFetchMode(PDO::FETCH_ASSOC);  
$row = $STH->fetch();  
ob_clean();
header("content-type: image/jpg") ; 
echo $row['image'] ; 
?>

数据库字段被称为image而不是Efaq_image