mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
204 lines
6.9 KiB
HTML
204 lines
6.9 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>Opens a Sybase server connection</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.sybase-connect" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">sybase_connect</h1>
|
|
<p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">sybase_connect</span> — <span class="dc-title">Opens a Sybase server connection</span></p>
|
|
|
|
</div>
|
|
|
|
<div id="function.sybase-connect-refsynopsisdiv">
|
|
<div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function was
|
|
<em class="emphasis">REMOVED</em> in PHP 7.0.0.</p></div>
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.sybase-connect-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>sybase_connect</strong></span>
|
|
([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$servername</code></span>
|
|
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$username</code></span>
|
|
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$password</code></span>
|
|
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$charset</code></span>
|
|
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$appname</code></span>
|
|
[, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$new</code><span class="initializer"> = <strong><code>FALSE</code></strong></span></span>
|
|
]]]]]] ) : <span class="type">resource</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
<span class="function"><strong>sybase_connect()</strong></span> establishes a connection to a
|
|
Sybase server.
|
|
</p>
|
|
<p class="para">
|
|
In case a second call is made to
|
|
<span class="function"><strong>sybase_connect()</strong></span> with the same arguments, no
|
|
new link will be established, but instead, the link identifier of
|
|
the already opened link will be returned.
|
|
</p>
|
|
<p class="para">
|
|
The link to the server will be closed as soon as the
|
|
execution of the script ends, unless it's closed earlier by
|
|
explicitly calling <span class="function"><a href="sybase_close.html" class="function">sybase_close()</a></span>.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.sybase-connect-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">servername</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The servername argument has to be a valid servername that is defined
|
|
in the 'interfaces' file.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">username</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Sybase user name
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">password</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Password associated with <code class="parameter">username</code>.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">charset</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Specifies the charset for the connection
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">appname</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Specifies an <em>appname</em> for the Sybase connection.
|
|
This allow you to make separate connections in the same script to the
|
|
same database. This may come handy when you have started a transaction
|
|
in your current connection, and you need to be able to do a separate
|
|
query which cannot be performed inside this transaction.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">new</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Whether to open a new connection or use the existing one.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.sybase-connect-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns a positive Sybase link identifier on success, or <strong><code>FALSE</code></strong> on
|
|
failure.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 changelog" id="refsect1-function.sybase-connect-changelog">
|
|
<h3 class="title">更新日志</h3>
|
|
<p class="para">
|
|
<table class="doctable informaltable">
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>版本</th>
|
|
<th>说明</th>
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="tbody">
|
|
<tr>
|
|
<td>5.3.0</td>
|
|
<td>
|
|
The <code class="parameter">new</code> parameter was added.
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.sybase-connect-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-2594">
|
|
<p><strong>Example #1 <span class="function"><strong>sybase_connect()</strong></span> example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br />$link </span><span style="color: #007700">= </span><span style="color: #0000BB">sybase_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'SYBASE'</span><span style="color: #007700">, </span><span style="color: #DD0000">''</span><span style="color: #007700">, </span><span style="color: #DD0000">''</span><span style="color: #007700">)<br /> or die(</span><span style="color: #DD0000">"Could not connect !"</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">sybase_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.sybase-connect-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="sybase_pconnect.html" class="function" rel="rdfs-seeAlso">sybase_pconnect()</a> - Open persistent Sybase connection</span></li>
|
|
<li class="member"><span class="function"><a href="sybase_close.html" class="function" rel="rdfs-seeAlso">sybase_close()</a> - Closes a Sybase connection</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |