Php Can';t在文档中过帐blob

Php Can';t在文档中过帐blob,php,mysql,pdo,blob,Php,Mysql,Pdo,Blob,我在下面的代码示例中遇到了问题: <?php $db = new PDO('mysql:host=localhost;dbname=zpanel_module_autoinstaller_core', 'paneluser', 'asdasd'); $stmt = $db->prepare("select type, data from cms_pictures where id=?"); $stmt->execute(array($_GET['id'])); $stmt-&g

我在下面的代码示例中遇到了问题:

<?php
$db = new PDO('mysql:host=localhost;dbname=zpanel_module_autoinstaller_core', 'paneluser', 'asdasd');
$stmt = $db->prepare("select type, data from cms_pictures where id=?");
$stmt->execute(array($_GET['id']));
$stmt->bindColumn(1, $type, PDO::PARAM_STR, 256);
$stmt->bindColumn(2, $lob, PDO::PARAM_LOB);
$stmt->fetch(PDO::FETCH_BOUND);

header("Content-Type: $type");
fpassthru($lob);
?>

如果我运行此代码,我会在Apache error.log中收到以下警告:

PHP警告:fpassthru()希望参数1是资源,字符串在第10行的/etc/…/test.PHP中给出

所以我想我在数据库中得到了错误的数据,但看起来不是这样。如果我看一下PHPMyAdmin,我得到了一张有效的照片。所以我认为,我将所有数据正确地放入数据库。如果我点击PHPMyAdmin中的Blob,我会得到一个有效的图像

有人有主意吗?找不到我的失败

非常感谢

请浏览此链接RTFM:。此函数需要一个文件句柄,而您正试图填充字符串。您只需要
echo$lob
。非常抱歉:(现在运行正常。非常感谢。