<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.pgsql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.pg-free-result.php',
    1 => 'pg_free_result',
    2 => 'Lib&egrave;re la m&eacute;moire',
  ),
  'up' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'pg_cancel_query',
  ),
  'prev' => 
  array (
    0 => 'function.pg-flush.php',
    1 => 'pg_flush',
  ),
  'next' => 
  array (
    0 => 'function.pg-get-notify.php',
    1 => 'pg_get_notify',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/pgsql/functions/pg-free-result.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.pg-free-result" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pg_free_result</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pg_free_result</span> &mdash; <span class="dc-title">
   Libère la mémoire
  </span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.pg-free-result-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pg_free_result</strong></span>(<span class="methodparam"><span class="type"><a href="class.pgsql-result.php" class="type PgSql\Result">PgSql\Result</a></span> <code class="parameter">$result</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>pg_free_result()</strong></span> libère la mémoire et les données associées
   avec l&#039;instance <span class="classname"><a href="class.pgsql-result.php" class="classname">PgSql\Result</a></span>.
  </p>
  <p class="para">
   <span class="function"><strong>pg_free_result()</strong></span> n&#039;est vraiment utile que si l&#039;on risque
   d&#039;utiliser trop de mémoire durant le script. La mémoire
   occupée par les résultats est automatiquement
   libérée à la fin du script.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Auparavant, cette fonction s&#039;appelait <span class="function"><strong>pg_freeresult()</strong></span>.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pg-free-result-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">result</code></dt>
     <dd>
      <p class="para">
 Une instance <span class="classname"><a href="class.pgsql-result.php" class="classname">PgSql\Result</a></span>, retourné par <span class="function"><a href="function.pg-query.php" class="function">pg_query()</a></span>,
 <span class="function"><a href="function.pg-query-params.php" class="function">pg_query_params()</a></span>, ou <span class="function"><a href="function.pg-execute.php" class="function">pg_execute()</a></span> (entre autres).
</p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-free-result-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.pg-free-result-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  Le paramètre <code class="parameter">result</code> attend désormais une instance de
  <span class="classname"><a href="class.pgsql-result.php" class="classname">PgSql\Result</a></span> ; auparavant, une <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> était attendu.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.pg-free-result-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>pg_free_result()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$db </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname=users user=me"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$res </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$db</span><span style="color: #007700">, </span><span style="color: #DD0000">"SELECT 1 UNION ALL SELECT 2"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$val </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_fetch_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #DD0000">"Le premier champ de la seconde ligne est : "</span><span style="color: #007700">, </span><span style="color: #0000BB">$val</span><span style="color: #007700">, </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">pg_free_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>L&#039;exemple ci-dessus va afficher :</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Le premier champ de la seconde ligne est : 2</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.pg-free-result-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.pg-query.php" class="function" rel="rdfs-seeAlso">pg_query()</a> - Ex&eacute;cute une requ&ecirc;te PostgreSQL</span></li>
    <li><span class="function"><a href="function.pg-query-params.php" class="function" rel="rdfs-seeAlso">pg_query_params()</a> - Envoie une commande au serveur et attend le r&eacute;sultat, avec les capacit&eacute;s de
   passer des param&egrave;tres s&eacute;par&eacute;ment de la commande texte SQL</span></li>
    <li><span class="function"><a href="function.pg-execute.php" class="function" rel="rdfs-seeAlso">pg_execute()</a> - Ex&eacute;cute une requ&ecirc;te pr&eacute;par&eacute;e PostGreSQL</span></li>
    <li><span class="function"><a href="function.pg-result-memory-size.php" class="function" rel="rdfs-seeAlso">pg_result_memory_size()</a> - Retourne la quantit&eacute; de m&eacute;moire allou&eacute;e pour un r&eacute;sultat de requ&ecirc;te</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>