mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
89 lines
5.6 KiB
HTML
89 lines
5.6 KiB
HTML
<!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>Close CUBRID connection</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.cubrid-close" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">cubrid_close</h1>
|
|
<p class="verinfo">(PECL CUBRID >= 8.3.1)</p><p class="refpurpose"><span class="refname">cubrid_close</span> — <span class="dc-title">Close CUBRID connection</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.cubrid-close-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>cubrid_close</strong></span>
|
|
([ <span class="methodparam"><span class="type">resource</span> <code class="parameter">$conn_identifier</code></span>
|
|
] ) : <span class="type">bool</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
The <span class="function"><strong>cubrid_close()</strong></span> function ends the transaction
|
|
currently in process, closes the connection handle and disconnects from
|
|
server. If there is any request handles not closed yet at this point,
|
|
they will be closed. It is similar to the CUBRID function
|
|
<span class="function"><a href="cubrid_disconnect.html" class="function">cubrid_disconnect()</a></span>.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.cubrid-close-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">conn_identifier</code></dt>
|
|
|
|
<dd>
|
|
<p class="para">The CUBRID connection identifier. If the connection identifier is not specified, the last connection opened by <span class="function"><a href="cubrid_connect.html" class="function">cubrid_connect()</a></span> is assumed.</p></dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.cubrid-close-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
<strong><code>TRUE</code></strong>, when process is successful.
|
|
</p>
|
|
<p class="para">
|
|
<strong><code>FALSE</code></strong>, when process is unsuccessful.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.cubrid-close-examples">
|
|
<h3 class="title">范例</h3>
|
|
<div class="example" id="example-1155">
|
|
<p><strong>Example #1 <span class="function"><strong>cubrid_close()</strong></span> example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br />$con </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_connect </span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">, </span><span style="color: #0000BB">33000</span><span style="color: #007700">, </span><span style="color: #DD0000">"demodb"</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">$con</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"connected successfully"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$req </span><span style="color: #007700">= </span><span style="color: #0000BB">cubrid_execute </span><span style="color: #007700">( </span><span style="color: #0000BB">$con</span><span style="color: #007700">, </span><span style="color: #DD0000">"insert into person values(1,'James')"</span><span style="color: #007700">);<br /> if (</span><span style="color: #0000BB">$req</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">cubrid_close_request </span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">cubrid_commit </span><span style="color: #007700">(</span><span style="color: #0000BB">$con</span><span style="color: #007700">);<br /> } else {<br /> </span><span style="color: #0000BB">cubrid_rollback </span><span style="color: #007700">(</span><span style="color: #0000BB">$con</span><span style="color: #007700">);<br /> }<br /> </span><span style="color: #0000BB">cubrid_close </span><span style="color: #007700">(</span><span style="color: #0000BB">$con</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.cubrid-close-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="cubrid_disconnect.html" class="function" rel="rdfs-seeAlso">cubrid_disconnect()</a> - Close a database connection</span></li>
|
|
<li class="member"><span class="function"><a href="cubrid_connect.html" class="function" rel="rdfs-seeAlso">cubrid_connect()</a> - Open a connection to a CUBRID Server</span></li>
|
|
<li class="member"><span class="function"><a href="cubrid_connect_with_url.html" class="function" rel="rdfs-seeAlso">cubrid_connect_with_url()</a> - Establish the environment for connecting to CUBRID server</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |