mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 06:18:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@283831 c90b9560-bf6c-de11-be94-00142212c4b1
125 lines
3.6 KiB
XML
125 lines
3.6 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<!-- Generated by xml_proto.php v2.3. Found in /scripts directory of phpdoc. -->
|
|
<refentry xml:id="function.pdo-pgsqllobopen" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>PDO::pgsqlLOBOpen</refname>
|
|
<refpurpose>Opens an existing large object stream</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>PDO::pgsqlLOBOpen</methodname>
|
|
<methodparam><type>string</type><parameter>oid</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>mode</parameter><initializer>"rb"</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>PDO::pgsqlLOBOpen</function> opens a stream to access the data
|
|
referenced by <parameter>oid</parameter>. If <parameter>mode</parameter>
|
|
is <literal>r</literal>, the stream is opened for reading, if
|
|
<parameter>mode</parameter> is <literal>w</literal>, then the stream will
|
|
be opened for writing. You can use all the usual filesystem functions,
|
|
such as <function>fread</function>, <function>fwrite</function> and
|
|
<function>fgets</function> to manipulate the contents of the stream.
|
|
</para>
|
|
<note>
|
|
<simpara>
|
|
This function, and all manipulations of the large object,
|
|
must be called and carried out within a transaction.
|
|
</simpara>
|
|
</note>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>oid</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
A large object identifier.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
If mode is <literal>r</literal>, open the stream for reading.
|
|
If mode is <literal>w</literal>, open the stream for writing.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns a stream resource on success, or &false; on failure.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>A <function>PDO::pgsqlLOBOpen</function> example</title>
|
|
<para>
|
|
Following on from the <function>PDO::pgsqlLOBCreate</function>
|
|
example, this code snippet retrieves the large object from
|
|
the database and outputs it to the browser.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$db = new PDO('pgsql:dbname=test host=localhost', $user, $pass);
|
|
$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->fetch(PDO::FETCH_BOUND);
|
|
fpassthru($lob);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>PDO::pgsqlLOBCreate</function></member>
|
|
<member><function>PDO::pgsqlLOBUnlink</function></member>
|
|
<member><function>pg_lo_open</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|