Removed named placeholder in cubrid_bind and autocommit property in connect url

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@325769 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Esen Sagynov 2012-05-22 05:30:08 +00:00
parent 09fb1b8150
commit 4774d2e9a2
3 changed files with 111 additions and 86 deletions

View file

@ -12,7 +12,7 @@
<methodsynopsis>
<type>bool</type><methodname>cubrid_bind</methodname>
<methodparam><type>resource</type><parameter>req_identifier</parameter></methodparam>
<methodparam><type>mixed</type><parameter>bind_param</parameter></methodparam>
<methodparam><type>int</type><parameter>bind_index</parameter></methodparam>
<methodparam><type>mixed</type><parameter>bind_value</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>bind_value_type</parameter></methodparam>
</methodsynopsis>
@ -142,13 +142,8 @@
<function>cubrid_prepare</function>.</para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>bind_param</parameter></term>
<listitem><para>Parameter identifier. For a prepared statement using named
placeholders, this will be a parameter name of the form :name (Note that
the name can only contain digit, alphabet, and underscore, and it can not
begin with digit. The name length can not be longer than 32). For a prepared
statement using question mark placeholders, this will be the 1-indexed
position of the parameter.</para></listitem>
<term><parameter>bind_index</parameter></term>
<listitem><para>Location of binding parameters. It starts with 1.</para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>bind_value</parameter></term>
@ -187,13 +182,6 @@
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
Added named parameter support; When binding the LOB data type, it can
directly binding the path name of a file.
</entry>
</row>
<row>
<entry>8.3.1</entry>
<entry>
@ -261,53 +249,6 @@ Barkley Charles
</screen>
</example>
<example>
<title><function>cubrid_bind</function> named parameter example</title>
<programlisting role="php">
<![CDATA[
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$sql_stmt = <<<EOD
SELECT s.name FROM stadium s, game g
WHERE s.code = g.stadium_code AND g.medal = :medal_type
GROUP BY g.stadium_code ORDER BY count(medal) DESC LIMIT 1;
EOD;
$req = cubrid_prepare($conn, $sql_stmt);
printf("%-30s %s\n", "Medal Type", "Stadium where most medals were ever won");
cubrid_bind($req, ":medal_type", "G");
cubrid_execute($req);
$row = cubrid_fetch_assoc($req);
printf("%-30s %s\n", "Gold", $row["name"]);
cubrid_bind($req, ":medal_type", "S");
cubrid_execute($req);
$row = cubrid_fetch_assoc($req);
printf("%-30s %s\n", "Silver", $row["name"]);
cubrid_bind($req, ":medal_type", "B");
cubrid_execute($req);
$row = cubrid_fetch_assoc($req);
printf("%-30s %s\n", "Bronze", $row["name"]);
cubrid_close_request($req);
cubrid_disconnect($conn);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Medal Type Stadium where most medals were ever won
Gold Olympic Aquatic Centre
Silver Olympic Aquatic Centre
Bronze Sydney Convention and Exhibition Centre
]]>
</screen>
</example>
<example>
<title><function>cubrid_bind</function> BLOB/CLOB example</title>
<programlisting role="php">

View file

@ -27,14 +27,33 @@
</para>
<para>
&lt;url&gt; ::= CUBRID:&lt;host&gt;:&lt;db_name&gt;:&lt;db_user&gt;:&lt;db_password&gt;:[?&lt;properties&gt;]
</para>
<para>
&lt;properties&gt; ::= &lt;property&gt; [&amp;&lt;property&gt;]
&lt;properties&gt; ::= autocommit=&lt;autocommit_mode&gt;
</para>
<para>
&lt;properties&gt; ::= alhosts=&lt;alternative_hosts&gt;[ &amp;rctime=&lt;time&gt;]
</para>
<para>
&lt;properties&gt; ::= login_timeout=&lt;milli_sec&gt;
</para>
<para>
&lt;properties&gt; ::= query_timeout=&lt;milli_sec&gt;
</para>
<para>
&lt;properties&gt; ::= disconnect_on_query_timeout=true|false
</para>
<para>
&lt;alternative_hosts&gt; ::= &lt;standby_broker1_host&gt;:&lt;port&gt; [,&lt;standby_broker2_host&gt;:&lt;port&gt;]
</para>
<para>
&lt;host&gt; := HOSTNAME | IP_ADDR
</para>
<para>
&lt;time&gt; := SECOND
</para>
<para>
or &lt;url&gt; ::= cci:CUBRID:&lt;host&gt;:&lt;db_name&gt;:......
&lt;milli_sec&gt; := MILLI SECOND
</para>
<para>
<simplelist>
@ -42,9 +61,31 @@
<member>db_name : A name of the database</member>
<member>db_user : A name of the database user</member>
<member>db_password : A database user password</member>
<member>autocommit : The database connection auto-commit mode</member>
<member>alhosts: Specifies the broker information of the standby server, which is used for failover when it is impossible to connect to the active server. You can specify multiple brokers for failover, and the connection to the brokers is attempted in the order listed in alhosts</member>
<member>rctime : An interval between the attempts to connect to the active broker in which failure occurred. After a failure occurs, the system connects to the broker specified by althosts (failover), terminates the transaction, and then attempts to connect to the active broker of the master database at every rctime. The default value is 600 seconds.</member>
<member>
alhosts : Specifies the broker information of the standby server, which is
used for failover when it is impossible to connect to the active server.
You can specify multiple brokers for failover, and the connection to the brokers
is attempted in the order listed in alhosts</member>
<member>
rctime : An interval between the attempts to connect to the active broker in
which failure occurred. After a failure occurs, the system connects to the
broker specified by althosts (failover), terminates the transaction, and then
attempts to connect to the active broker of the master database at every rctime.
The default value is 600 seconds.</member>
<member>
login_timeout : Timeout value (unit: msec.) for database login. The default
value is 0, which means infinite postponement.
</member>
<member>
query_timeout : Timeout value (unit: msec.) for query request. Upon timeout,
a message to cancel requesting a query transferred to server is sent. The return
value can depend on the disconnect_on_query_timeout configuration; even though the
message to cancel a request is sent to server, that request may succeed.
</member>
<member>
disconnect_on_query_timeout : Configures a value whether to immediately return
an error of function being executed upon timeout. The default value is false.
</member>
</simplelist>
</para>
<note>
@ -63,7 +104,9 @@
</para>
<para>
$url = "CUBRID:localhost:33000:tbd:::?autocommit=off";
$conn = cubrid_connect_with_url ($url, "dba", "12?");
</para>
<para>
$conn = cubrid_connect_with_url($url, "dba", "12?");
</para>
</note>
</refsect1>
@ -91,8 +134,8 @@
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
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>
@ -116,20 +159,20 @@
<programlisting role="php">
<![CDATA[
<?php
$conn_url = "CUBRID:127.0.0.1:33088:demodb:dba:123456:?autocommit=off"
$con = cubrid_connect_with_url ($conn_url);
$conn_url = "CUBRID:localhost:33000:demodb:public:123456";
$con = cubrid_connect_with_url($conn_url);
if ($con) {
echo "connected successfully";
$req =cubrid_execute($con, "insert into person values(1,'James')");
if ($req) {
cubrid_close_request ($req);
cubrid_commit ($con);
cubrid_close_request($req);
cubrid_commit($con);
} else {
cubrid_rollback ($con);
cubrid_rollback($con);
}
cubrid_disconnect ($con);
cubrid_disconnect($con);
}
?>
]]>
@ -141,7 +184,7 @@ if ($con) {
<programlisting role="php">
<![CDATA[
<?php
$conn_url = "CUBRID:127.0.0.1:33088:demodb:dba:123456:?autocommit=off&althost=10.34.63.132:33088&rctime=100"
$conn_url = "CUBRID:127.0.0.1:33000:demodb:public:123456:?althost=10.34.63.132:33088&rctime=100"
$con = cubrid_connect_with_url ($conn_url);
if ($con) {
@ -149,12 +192,12 @@ if ($con) {
$req =cubrid_execute($con, "insert into person values(1,'James')");
if ($req) {
cubrid_close_request ($req);
cubrid_commit ($con);
cubrid_close_request($req);
cubrid_commit($con);
} else {
cubrid_rollback ($con);
cubrid_rollback($con);
}
cubrid_disconnect ($con);
cubrid_disconnect($con);
}
?>
]]>

View file

@ -40,14 +40,33 @@
</para>
<para>
&lt;url&gt; ::= CUBRID:&lt;host&gt;:&lt;db_name&gt;:&lt;db_user&gt;:&lt;db_password&gt;:[?&lt;properties&gt;]
</para>
<para>
&lt;properties&gt; ::= &lt;property&gt; [&amp;&lt;property&gt;]
&lt;properties&gt; ::= autocommit=&lt;autocommit_mode&gt;
</para>
<para>
&lt;properties&gt; ::= alhosts=&lt;alternative_hosts&gt;[ &amp;rctime=&lt;time&gt;]
</para>
<para>
&lt;properties&gt; ::= login_timeout=&lt;milli_sec&gt;
</para>
<para>
&lt;properties&gt; ::= query_timeout=&lt;milli_sec&gt;
</para>
<para>
&lt;properties&gt; ::= disconnect_on_query_timeout=true|false
</para>
<para>
&lt;alternative_hosts&gt; ::= &lt;standby_broker1_host&gt;:&lt;port&gt; [,&lt;standby_broker2_host&gt;:&lt;port&gt;]
</para>
<para>
&lt;host&gt; := HOSTNAME | IP_ADDR
</para>
<para>
&lt;time&gt; := SECOND
</para>
<para>
or &lt;url&gt; ::= cci:CUBRID:&lt;host&gt;:&lt;db_name&gt;:......
&lt;milli_sec&gt; := MILLI SECOND
</para>
<para>
<simplelist>
@ -55,9 +74,31 @@
<member>db_name : A name of the database</member>
<member>db_user : A name of the database user</member>
<member>db_password : A database user password</member>
<member>autocommit : The database connection auto-commit mode</member>
<member>alhosts: Specifies the broker information of the standby server, which is used for failover when it is impossible to connect to the active server. You can specify multiple brokers for failover, and the connection to the brokers is attempted in the order listed in alhosts</member>
<member>rctime : An interval between the attempts to connect to the active broker in which failure occurred. After a failure occurs, the system connects to the broker specified by althosts (failover), terminates the transaction, and then attempts to connect to the active broker of the master database at every rctime. The default value is 600 seconds.</member>
<member>
alhosts : Specifies the broker information of the standby server, which is
used for failover when it is impossible to connect to the active server.
You can specify multiple brokers for failover, and the connection to the brokers
is attempted in the order listed in alhosts</member>
<member>
rctime : An interval between the attempts to connect to the active broker in
which failure occurred. After a failure occurs, the system connects to the
broker specified by althosts (failover), terminates the transaction, and then
attempts to connect to the active broker of the master database at every rctime.
The default value is 600 seconds.</member>
<member>
login_timeout : Timeout value (unit: msec.) for database login. The default
value is 0, which means infinite postponement.
</member>
<member>
query_timeout : Timeout value (unit: msec.) for query request. Upon timeout,
a message to cancel requesting a query transferred to server is sent. The return
value can depend on the disconnect_on_query_timeout configuration; even though the
message to cancel a request is sent to server, that request may succeed.
</member>
<member>
disconnect_on_query_timeout : Configures a value whether to immediately return
an error of function being executed upon timeout. The default value is false.
</member>
</simplelist>
</para>
<note>