mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Added examples about query timeout; Added the new_link parameter in cubrid_connect and cubrid_connect_with_url to make it more compatibility with mysql
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@319539 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
b1798ccb79
commit
6e9cb95346
3 changed files with 64 additions and 10 deletions
|
@ -14,6 +14,7 @@
|
|||
<methodparam><type>string</type><parameter>conn_url</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>userid</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>passwd</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>new_link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>cubrid_connect_with_url</function> function is used to
|
||||
|
@ -22,11 +23,7 @@
|
|||
enabled in CUBRID, you must specify the connection information of the
|
||||
standby server, which is used for failover when failure occurs, in the url
|
||||
string argument of this function. If the user name and password is not
|
||||
given, then the "PUBLIC" connection will be made by default. If a second
|
||||
call is made to <function>cubrid_connect</function> with the same
|
||||
<parameter>conn_url</parameter>, and <parameter>userid</parameter> as an
|
||||
existing connection, the existing connection will be returned unless you
|
||||
pass.
|
||||
given, then the "PUBLIC" connection will be made by default.
|
||||
</para>
|
||||
<para>
|
||||
<url> ::= CUBRID:<host>:<db_name>:<db_user>:<db_password>:[?<properties>]
|
||||
|
@ -68,6 +65,17 @@
|
|||
<term><parameter>passwd</parameter></term>
|
||||
<listitem><para>User password.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>new_link</parameter></term>
|
||||
<listitem><para>If a second call is made to
|
||||
<function>cubrid_connect_with_url</function> with the same arguments,
|
||||
no new connection will be established, but instead, the connection
|
||||
identifier of the already opened connection will be returned. The
|
||||
<parameter>new_link</parameter> parameter modifies this behavior and
|
||||
makes <function> cubrid_connect_with_url</function> always open a new
|
||||
connection, even if <function> cubrid_connect_with_url</function> was
|
||||
called before with the same parameters.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -16,17 +16,14 @@
|
|||
<methodparam><type>string</type><parameter>dbname</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>userid</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>passwd</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>new_link</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>cubrid_connect</function> function is used to establish the
|
||||
environment for connecting to your server by using your server address,
|
||||
port number, database name, user name, and password. If the user name and
|
||||
password is not given, then the "PUBLIC" connection will be made by
|
||||
default. If a second call is made to <function>cubrid_connect</function>
|
||||
with the same <parameter>host</parameter>, <parameter>port</parameter>,
|
||||
<parameter>dbname</parameter> and <parameter>userid</parameter> as an
|
||||
existing connection, the existing connection will be returned unless you
|
||||
pass.
|
||||
default.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -54,6 +51,17 @@
|
|||
<term><parameter>passwd</parameter></term>
|
||||
<listitem><para>User password.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>new_link</parameter></term>
|
||||
<listitem><para>If a second call is made to
|
||||
<function>cubrid_connect</function> with the same arguments, no new
|
||||
connection will be established, but instead, the connection identifier
|
||||
of the already opened connection will be returned. The
|
||||
<parameter>new_link</parameter> parameter modifies this behavior and
|
||||
makes <function>cubrid_connect</function> always open a new connection,
|
||||
even if <function>cubrid_connect</function> was called before with the
|
||||
same parameters.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -41,6 +41,44 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>cubrid_get_query_timeout</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$host = "localhost";
|
||||
$port = 33000;
|
||||
$db = "demodb";
|
||||
|
||||
$conn =
|
||||
cubrid_connect_with_url("CUBRID:$host:$port:$db:::?&login_timeout=50000&query_timeout=5000&disconnect_on_query_timeout=yes");
|
||||
|
||||
$req = cubrid_prepare($conn, "SELECT * FROM code");
|
||||
|
||||
$timeout = cubrid_get_query_timeout($req);
|
||||
var_dump($timeout);
|
||||
|
||||
cubrid_set_query_timeout($req, 1000);
|
||||
$timeout = cubrid_get_query_timeout($req);
|
||||
var_dump($timeout);
|
||||
|
||||
cubrid_close($conn);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
int(5000)
|
||||
int(1000)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue