2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2009-07-11 08:13:42 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.mysql-close" xmlns="http://docbook.org/ns/docbook">
|
2005-03-30 04:07:29 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>mysql_close</refname>
|
|
|
|
<refpurpose>Close MySQL connection</refpurpose>
|
|
|
|
</refnamediv>
|
2005-03-30 05:05:08 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>mysql_close</methodname>
|
|
|
|
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
<function>mysql_close</function> closes the non-persistent connection to
|
|
|
|
the MySQL server that's associated with the specified link identifier. If
|
|
|
|
<parameter>link_identifier</parameter> isn't specified, the last opened
|
|
|
|
link is used.
|
2005-03-30 04:07:29 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Using <function>mysql_close</function> isn't usually necessary,
|
|
|
|
as non-persistent open links are automatically closed at the end
|
|
|
|
of the script's execution. See also
|
|
|
|
<link linkend="language.types.resource.self-destruct">freeing
|
|
|
|
resources</link>.
|
|
|
|
</para>
|
2005-03-30 05:05:08 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
2005-03-31 07:47:25 +00:00
|
|
|
&mysql.linkid.description;
|
2005-03-30 05:05:08 +00:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
&return.success;
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>mysql_close</function> example</title>
|
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2004-02-20 17:36:42 +00:00
|
|
|
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
|
|
|
|
if (!$link) {
|
|
|
|
die('Could not connect: ' . mysql_error());
|
|
|
|
}
|
|
|
|
echo 'Connected successfully';
|
2004-01-05 13:03:26 +00:00
|
|
|
mysql_close($link);
|
2002-04-15 00:12:54 +00:00
|
|
|
?>
|
|
|
|
]]>
|
2005-03-30 04:07:29 +00:00
|
|
|
</programlisting>
|
2005-03-30 05:05:08 +00:00
|
|
|
&example.outputs;
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
Connected successfully
|
|
|
|
]]>
|
|
|
|
</screen>
|
2005-03-30 04:07:29 +00:00
|
|
|
</example>
|
|
|
|
</para>
|
2005-03-30 05:05:08 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
<function>mysql_close</function> will not close persistent links
|
|
|
|
created by <function>mysql_pconnect</function>.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
2005-03-30 04:07:29 +00:00
|
|
|
<para>
|
2005-03-30 05:05:08 +00:00
|
|
|
<simplelist>
|
|
|
|
<member><function>mysql_connect</function></member>
|
|
|
|
<member><function>mysql_free_result</function></member>
|
|
|
|
</simplelist>
|
2005-03-30 04:07:29 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
|
|
|
-->
|