mirror of
https://github.com/php/doc-zh.git
synced 2026-03-24 07:02:15 +01:00
* Update pg-close.xml * Update pg-flush.xml * Update pg-free-result.xml * Update pg-insert.xml * Update pg-last-notice.xml * Update pg-lo-export.xml * Update pg-insert.xml * Update pg-last-notice.xml
130 lines
3.2 KiB
XML
Executable File
130 lines
3.2 KiB
XML
Executable File
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 2ca090342977839edca2f7f4e52305a1b5da6095 Maintainer: HonestQiao Status: ready -->
|
|
<!-- CREDITS: mowangjuanzi -->
|
|
<refentry xml:id="function.pg-close" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>pg_close</refname>
|
|
<refpurpose>关闭 PostgreSQL 连接</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>true</type><methodname>pg_close</methodname>
|
|
<methodparam choice="opt"><type class="union"><type>PgSql\Connection</type><type>null</type></type><parameter>connection</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>pg_close</function> 关闭与指定 <parameter>connection</parameter>
|
|
实例关联的 PostgreSQL 数据库的非持久连接。
|
|
</para>
|
|
<note>
|
|
<para>
|
|
通常不需要使用 <function>pg_close</function>,因为打开的非持久连接会在脚本结束时自动关闭。
|
|
</para>
|
|
</note>
|
|
<para>
|
|
如果连接上有打开的 <classname>PgSql\Lob</classname> 实例,请不要在关闭所有 <classname>PgSql\Lob</classname> 实例之前关闭连接。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>connection</parameter></term>
|
|
<listitem>
|
|
&pgsql.parameter.connection-with-nullable-default;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.true.always;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
&return.type.true;
|
|
&pgsql.changelog.connection-object;
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>connection</parameter> 现在可以为 null。
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>pg_close</function> 示例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$dbconn = pg_connect("host=localhost port=5432 dbname=mary")
|
|
or die("Could not connect");
|
|
echo "Connected successfully";
|
|
pg_close($dbconn);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Connected successfully
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>pg_connect</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:"~/.phpdoc/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
|
|
-->
|