mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
92 lines
3.5 KiB
HTML
92 lines
3.5 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>Open persistent mSQL connection</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.msql-pconnect" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">msql_pconnect</h1>
|
|
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">msql_pconnect</span> — <span class="dc-title">Open persistent mSQL connection</span></p>
|
|
|
|
</div>
|
|
<div class="refsect1 description" id="refsect1-function.msql-pconnect-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>msql_pconnect</strong></span>
|
|
([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$hostname</code></span>
|
|
] ) : <span class="type">resource</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
<span class="function"><strong>msql_pconnect()</strong></span> acts very much like
|
|
<span class="function"><a href="msql_connect.html" class="function">msql_connect()</a></span> with two major differences.
|
|
</p>
|
|
<p class="para">
|
|
First, when connecting, the function would first try to find a
|
|
(persistent) link that's already open with the same host.
|
|
If one is found, an identifier for it will be returned instead of opening
|
|
a new connection.
|
|
</p>
|
|
<p class="para">
|
|
Second, the connection to the SQL server will not be closed when the
|
|
execution of the script ends. Instead, the link will remain open for
|
|
future use (<span class="function"><a href="msql_close.html" class="function">msql_close()</a></span> will not close links
|
|
established by this function).
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.msql-pconnect-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">hostname</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The hostname can also include a port number. e.g.
|
|
<em>hostname,port</em>.
|
|
</p>
|
|
<p class="para">
|
|
If not specified, the connection is established by the means of a Unix
|
|
domain socket, being more efficient than a localhost TCP socket
|
|
connection.
|
|
</p>
|
|
<blockquote class="note"><p><strong class="note">Note</strong>:
|
|
<span class="simpara">
|
|
While this function will accept a colon (<em>:</em>) as a
|
|
host/port separator, a comma (<em>,</em>) is the preferred
|
|
method.
|
|
</span>
|
|
</p></blockquote>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.msql-pconnect-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns a positive mSQL link identifier on success, or <strong><code>FALSE</code></strong> on
|
|
error.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.msql-pconnect-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="msql_connect.html" class="function" rel="rdfs-seeAlso">msql_connect()</a> - Open mSQL connection</span></li>
|
|
<li class="member"><span class="function"><a href="msql_close.html" class="function" rel="rdfs-seeAlso">msql_close()</a> - Close mSQL connection</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
</div></div></div></body></html> |