note 110569 added to pdo.lobs
| From: | vicrry at yahoo dot com dot hk | Date: | Thu, 08 Nov 2012 08:52:10 +0000 |
| Subject: | note 110569 added to pdo.lobs | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191807@lists.php.net to get a copy of this message | ||
In addition to the previous comment, one should always be memory cautious when working with stream.
The handy stream function stream_copy_to_stream() works like a charm in pipe situations.
<?php
$stmt = $pdo->con->prepare( 'select * from filetable' );
$stmt->execute();
$res = $stmt->fetchAll( PDO::FETCH_ASSOC );
for( $i=0; $i<count($res); $i++ ) {
$file = fopen("C:/tmp/".$res[$i]['FILE_ID'].'.xml', 'w');
stream_copy_to_stream($res[$i]['DATA_FILE'], $file);
}
?>
----
Server IP: 69.147.83.199
Probable Submitter: 61.244.243.126
----
Manual Page -- http://www.php.net/manual/en/pdo.lobs.php
Edit -- https://master.php.net/note/edit/110569
Del: integrated -- https://master.php.net/note/delete/110569/integrated
Del: useless -- https://master.php.net/note/delete/110569/useless
Del: bad code -- https://master.php.net/note/delete/110569/bad+code
Del: spam -- https://master.php.net/note/delete/110569/spam
Del: non-english -- https://master.php.net/note/delete/110569/non-english
Del: in docs -- https://master.php.net/note/delete/110569/in+docs
Del: other reasons-- https://master.php.net/note/delete/110569
Reject -- https://master.php.net/note/reject/110569
Search -- https://master.php.net/manage/user-notes.php