Fix the example according to user contributed notes

The column "oid" doesn't contain the large object itself but its identifier.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329258 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
TAKAGI Masahiro 2013-01-21 20:11:09 +00:00
parent c0a67e0c16
commit 058f45a9c9

View file

@ -78,9 +78,11 @@ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->beginTransaction();
$stmt = $db->prepare("select oid from BLOBS where ident = ?");
$stmt->execute(array($some_id));
$stmt->bindColumn('oid', $lob, PDO::PARAM_LOB);
$stmt->bindColumn('oid', $oid, PDO::PARAM_STR);
$stmt->fetch(PDO::FETCH_BOUND);
fpassthru($lob);
$stream = $db->pgsqlLOBOpen($oid, 'r');
header("Content-type: application/octet-stream");
fpassthru($stream);
?>
]]>
</programlisting>