php-doc-en/reference/mysql/functions/mysql-free-result.xml
Philip Olson d796253cd2 WS (ugh)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@163410 c90b9560-bf6c-de11-be94-00142212c4b1
2004-07-15 21:45:15 +00:00

88 lines
2.6 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.102 -->
<refentry id="function.mysql-free-result">
<refnamediv>
<refname>mysql_free_result</refname>
<refpurpose>Free result memory</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mysql_free_result</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
</methodsynopsis>
<para>
<function>mysql_free_result</function> will free all memory
associated with the result identifier <parameter>result</parameter>.
</para>
<para>
<function>mysql_free_result</function> only needs to be called if
you are concerned about how much memory is being used for queries
that return large result sets. All associated result memory is
automatically freed at the end of the script's execution.
</para>
<para>
&return.success;
</para>
<para>
If a non-resource is used for the <parameter>result</parameter>, an
error of level E_WARNING will be emitted. It's worth noting that
<function>mysql_query</function> only returns a <type>resource</type>
for SELECT, SHOW, EXPLAIN, and DESCRIBE queries.
</para>
<para>
<example>
<title>A <function>mysql_free_result</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
/* Use the result, assuming we're done with it afterwords */
$row = mysql_fetch_assoc($result);
/* Now we free up the result and continue on with our script */
mysql_free_result($result);
echo $row['id'];
echo $row['email'];
?>
]]>
</programlisting>
</example>
</para>
<para>
For downward compatibility <function>mysql_freeresult</function>
can also be used. This is deprecated, however.
</para>
<para>
See also <function>mysql_query</function> and
<function>is_resource</function>.
</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
-->