Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 5788

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Seeks position within a large object</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pg-lo-read.html">pg_lo_read</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pg-lo-tell.html">pg_lo_tell</a></div>
 <div class="up"><a href="ref.pgsql.html">PostgreSQL Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.pg-lo-seek" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pg_lo_seek</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">pg_lo_seek</span> &mdash; <span class="dc-title">
   Seeks position within a large object
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.pg-lo-seek-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>pg_lo_seek</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$large_object</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$whence</code><span class="initializer"> = PGSQL_SEEK_CUR</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>pg_lo_seek()</strong></span> seeks a position within a large object
   resource.
  </p>
  <p class="para">
   To use the large object interface, it is necessary to
   enclose it within a transaction block.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pg-lo-seek-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">large_object</code></dt>

     <dd>

      <p class="para">
       PostgreSQL large object (LOB) resource, returned by <span class="function"><a href="function.pg-lo-open.html" class="function">pg_lo_open()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">offset</code></dt>

     <dd>

      <p class="para">
       The number of bytes to seek.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">whence</code></dt>

     <dd>

      <p class="para">
       One of the constants <strong><code>PGSQL_SEEK_SET</code></strong> (seek from object start), 
       <strong><code>PGSQL_SEEK_CUR</code></strong> (seek from current position)
       or <strong><code>PGSQL_SEEK_END</code></strong> (seek from object end) .
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-lo-seek-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.pg-lo-seek-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-2574">
    <p><strong>Example #1 <span class="function"><strong>pg_lo_seek()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;$doc_oid&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">189762345</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$database&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname=jacarta"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"begin"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$handle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pg_lo_open</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$doc_oid</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"r"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Skip&nbsp;first&nbsp;50000&nbsp;bytes<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">pg_lo_seek</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50000</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PGSQL_SEEK_SET</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Read&nbsp;the&nbsp;next&nbsp;10000&nbsp;bytes<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pg_lo_read</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10000</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"commit"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div> 
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.pg-lo-seek-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.6.0</td>
       <td>
        Added PostgreSQL 9.3&#039;s 64bit large object support. Both client and server must
        support PostgreSQL 9.3 and PHP must be 64bit build to use 64bit large object.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.pg-lo-seek-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.pg-lo-tell.html" class="function" rel="rdfs-seeAlso">pg_lo_tell()</a> - Returns current seek position a of large object</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pg-lo-read.html">pg_lo_read</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pg-lo-tell.html">pg_lo_tell</a></div>
 <div class="up"><a href="ref.pgsql.html">PostgreSQL Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>