note 119464 added to pdo.lobs
| From: | ben dot leiting at gmail dot com | Date: | Mon, 13 Jun 2016 17:56:19 +0000 |
| Subject: | note 119464 added to pdo.lobs | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205706@lists.php.net to get a copy of this message | ||
For selecting data out of Postgres, the data type of the column in the table determined if the
parameter bound with PARAM_LOB returned a string or returned a resource.
<?php
// create table log ( data text ) ;
$geth = $dbh->prepare('select data from log ');
$geth->execute();
$geth->bindColumn(1, $dataString, PDO::PARAM_LOB);
$geth->fetch(PDO::FETCH_BOUND);
echo ($dataString); // $dataString is a string
// create table log ( data bytea ) ;
$geth = $dbh->prepare('select data from log');
$geth->execute();
$geth->bindColumn(1, $dataFH, PDO::PARAM_LOB);
$geth->fetch(PDO::FETCH_BOUND);
fpassthru($dataFH); // $dataFH is a resource
----
Server IP: 72.52.91.14
Probable Submitter: 50.130.178.128
----
Manual Page -- http://php.net/manual/en/pdo.lobs.php
Edit -- https://master.php.net/note/edit/119464
Del: integrated -- https://master.php.net/note/delete/119464/integrated
Del: useless -- https://master.php.net/note/delete/119464/useless
Del: bad code -- https://master.php.net/note/delete/119464/bad+code
Del: spam -- https://master.php.net/note/delete/119464/spam
Del: non-english -- https://master.php.net/note/delete/119464/non-english
Del: in docs -- https://master.php.net/note/delete/119464/in+docs
Del: other reasons-- https://master.php.net/note/delete/119464
Reject -- https://master.php.net/note/reject/119464
Search -- https://master.php.net/manage/user-notes.php