note 89398 added to function.pdo-pgsqllobopen

From: Date: Fri, 06 Mar 2009 00:54:54 +0000
Subject: note 89398 added to function.pdo-pgsqllobopen
Groups: php.notes 
Request: Send a blank email to php-notes+get-151542@lists.php.net to get a copy of this message
This is what worked for me. If you have the oid, then all you need to do is: <?php $pdo = new PDO($dsn, $user, $pass); $pdo->beginTransaction(); $data = $pdo->pgsqlLOBOpen($oid, 'r'); header("Content-Type: $mime"); // any other headers... fpassthru($data); // echo stream_get_contents($data); also works ?> The beginTransaction() is required, if you want to $pdo->commit() (it's not required) then do it after the fpassthru. On a side note, those using Zend Framework can call getConnection() on the standard PDO database object which will get them the $pdo object as above. Then just remember to disableLayout() and setNoRender() as necessary. ---- Server IP: 69.147.83.197 Probable Submitter: 81.174.171.57 ---- Manual Page -- http://www.php.net/manual/en/function.pdo-pgsqllobopen.php Edit -- https://master.php.net/note/edit/89398 Del: integrated -- https://master.php.net/note/delete/89398/integrated Del: useless -- https://master.php.net/note/delete/89398/useless Del: bad code -- https://master.php.net/note/delete/89398/bad+code Del: spam -- https://master.php.net/note/delete/89398/spam Del: non-english -- https://master.php.net/note/delete/89398/non-english Del: in docs -- https://master.php.net/note/delete/89398/in+docs Del: other reasons-- https://master.php.net/note/delete/89398 Reject -- https://master.php.net/note/reject/89398 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#151542) next »