Modified functions that reference to each other

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@321057 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Esen Sagynov 2011-12-16 02:51:23 +00:00
parent be93f1830c
commit 6250dd610e
7 changed files with 73 additions and 133 deletions

View file

@ -14,7 +14,8 @@
<methodparam choice="opt"><type>resource</type><parameter>conn_identifier</parameter></methodparam>
</methodsynopsis>
<para>
This function returns the current CUBRID connection charset.
This function returns the current CUBRID connection charset and is similar
to the CUBRID function <function>cubrid_get_charset</function>.
</para>
</refsect1>
@ -47,27 +48,28 @@
<programlisting role="php">
<![CDATA[
<?php
$con = cubrid_connect("localhost", 33000, "demodb");
if (!$con)
{
die('Could not connect.');
}
printf("CUBRID current charset: %s\n", cubrid_client_encoding($con));
$con = cubrid_connect("localhost", 33000, "demodb");
if (!$con)
{
die('Could not connect.');
}
printf("CUBRID current charset: %s\n", cubrid_client_encoding($con));
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Result:
CUBRID current charset: iso8859-1
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>

View file

@ -17,7 +17,8 @@
The <function>cubrid_close</function> function ends the transaction
currently on process, closes the connection handle and disconnects from
server. If there exists any request handle not closed yet at this point,
it will be closed.
it will be closed. It is similar to the CUBRID function
<function>cubrid_disconnect</function>.
</para>
</refsect1>
@ -72,7 +73,9 @@ if ($con) {
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_disconnect</function></member>
<member><function>cubrid_connect</function></member>
<member><function>cubrid_connect_with_url</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -65,7 +65,7 @@ for ($i = 0; $i < 5; $i++) {
cubrid_execute($conn, "DELETE FROM cubrid_test");
$affected_num = cubrid_affected_rows();
var_dump($affected_num);
printf("Rows deleted: %d\n", $affected_num);
cubrid_disconnect($conn);
?>
@ -74,7 +74,7 @@ cubrid_disconnect($conn);
&example.outputs;
<screen>
<![CDATA[
int(5)
Rows deleted: 5
]]>
</screen>
</example>

View file

@ -14,7 +14,10 @@
<methodparam><type>resource</type><parameter>req_identifier</parameter></methodparam>
</methodsynopsis>
<para>
The <function>cubrid_close_prepare</function> function closes the request handle given by the <parameter>req_identifier</parameter> argument, and releases the memory region related to the handle.
The <function>cubrid_close_prepare</function> function closes the request
handle given by the <parameter>req_identifier</parameter> argument, and
releases the memory region related to the handle. It is a alias of
<function>cubrid_close_request</function>.
</para>
</refsect1>
@ -57,7 +60,7 @@ if ($con) {
echo $id;
echo $name;
}
cubrid_close_prepare($re1);
cubrid_close_prepare($req); // or you can use cubrid_close_request($req)
}
cubrid_disconnect($con);
}
@ -71,7 +74,7 @@ if ($con) {
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_execute</function></member>
<member><function>cubrid_close_request</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -16,7 +16,8 @@
<para>
The <function>cubrid_close_request</function> function closes the request
handle given by the <parameter>req_identifier</parameter> argument, and
releases the memory region related to the handle.
releases the memory region related to the handle. It is a alias of
<function>cubrid_close_prepare</function>.
</para>
</refsect1>
@ -49,37 +50,23 @@
<programlisting role="php">
<![CDATA[
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$req = cubrid_prepare ($conn, "SELECT * FROM olympic WHERE host_year=?");
$host_year = 2004;
cubrid_bind($req, 1, $host_year, "number");
cubrid_execute($req);
printf("%-9s %-11s %-9s %-12s %-12s %-15s %-15s\n",
"host_year", "host_nation", "host_city", "opening_date",
"closing_date", "mascot", "slogan");
while ($row = cubrid_fetch_assoc($req)) {
printf("%-9s %-11s %-9s %-12s %-12s %-15s %-15s\n",
$row["host_year"], $row["host_nation"], $row["host_city"],
$row["opening_date"], $row["closing_date"], $row["mascot"], $row["slogan"]);
$con = cubrid_connect ("dbsvr.cubrid.com", 12345, "demodb");
if ($con) {
echo "connected successfully";
$req = cubrid_execute ( $con, "select * from members",
CUBRID_INCLUDE_OID | CUBRID_ASYNC);
if ($req) {
while ( list ($id, $name) = cubrid_fetch ($req) ){
echo $id;
echo $name;
}
cubrid_close_requst($req); // or you can use cubrid_close_prepare($req)
}
cubrid_disconnect($con);
}
cubrid_close_request($req);
cubrid_disconnect($conn);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
host_year host_nation host_city opening_date closing_date mascot slogan
2004 Greece Athens 2004-8-13 2004-8-29 Athena Phevos Welcome Home
]]>
</screen>
</example>
</refsect1>
@ -87,12 +74,12 @@ host_year host_nation host_city opening_date closing_date mascot slogan
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_execute</function></member>
<member><function>cubrid_close_prepare</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -16,7 +16,8 @@
<para>
The <function>cubrid_disconnect</function> function closes the connection
handle and disconnects from server. If there exists any request handle not
closed yet at this point, it will be closed.
closed yet at this point, it will be closed. It is similar to the CUBRID
MySQL compatible function <function>cubrid_close</function>.
</para>
</refsect1>
@ -49,56 +50,21 @@
<programlisting role="php">
<![CDATA[
<?php
printf("%-30s %s\n", "CUBRID PHP Version:", cubrid_version());
printf("\n");
$conn = cubrid_connect("localhost", 33000, "demodb");
if (!$conn) {
die('Connect Error ('. cubrid_error_code() .')' . cubrid_error_msg());
$con = cubrid_connect ("210.211.133.100", 12345, "demodb");
if ($con) {
echo "connected successfully";
$req = cubrid_execute( $con, "insert into person values(1,'James')");
if ($req) {
cubrid_close_request($req);
cubrid_commit($con);
} else {
cubrid_rollback($con);
}
cubrid_disconnect($con);
}
$db_params = cubrid_get_db_parameter($conn);
while (list($param_name, $param_value) = each($db_params)) {
printf("%-30s %s\n", $param_name, $param_value);
}
printf("\n");
$server_info = cubrid_get_server_info($conn);
$client_info = cubrid_get_client_info();
printf("%-30s %s\n", "Server Info:", $server_info);
printf("%-30s %s\n", "Client Info:", $client_info);
printf("\n");
$charset = cubrid_get_charset($conn);
printf("%-30s %s\n", "CUBRID Charset:", $charset);
cubrid_disconnect($conn);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
CUBRID PHP Version: 8.3.1.0005
PARAM_ISOLATION_LEVEL 3
LOCK_TIMEOUT -1
MAX_STRING_LENGTH 1073741823
PARAM_AUTO_COMMIT 0
Server Info: 8.3.1.0173
Client Info: 8.3.1
CUBRID Charset: iso8859-1
]]>
</screen>
</example>
</refsect1>
@ -106,7 +72,9 @@ CUBRID Charset: iso8859-1
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_close</function></member>
<member><function>cubrid_connect</function></member>
<member><function>cubrid_connect_with_url</function></member>
</simplelist>
</para>
</refsect1>

View file

@ -14,8 +14,9 @@
<methodparam><type>resource</type><parameter>conn_identifier</parameter></methodparam>
</methodsynopsis>
<para>
This function returns This function returns the current CUBRID connection
charset.
This function returns the current CUBRID connection charset and is similar
to the CUBRID MySQL compatible function
<function>cubrid_client_encoding</function>.
</para>
</refsect1>
@ -48,37 +49,14 @@
<programlisting role="php">
<![CDATA[
<?php
printf("%-30s %s\n", "CUBRID PHP Version:", cubrid_version());
printf("\n");
$conn = cubrid_connect("localhost", 33088, "demodb");
if (!$conn) {
die('Connect Error ('. cubrid_error_code() .')' . cubrid_error_msg());
$con = cubrid_connect("localhost", 33000, "demodb");
if (!$con)
{
die('Could not connect.');
}
$db_params = cubrid_get_db_parameter($conn);
while (list($param_name, $param_value) = each($db_params)) {
printf("%-30s %s\n", $param_name, $param_value);
}
printf("\n");
$server_info = cubrid_get_server_info($conn);
$client_info = cubrid_get_client_info();
printf("%-30s %s\n", "Server Info:", $server_info);
printf("%-30s %s\n", "Client Info:", $client_info);
printf("\n");
$charset = cubrid_get_charset($conn);
printf("%-30s %s\n", "CUBRID Charset:", $charset);
cubrid_disconnect($conn);
printf("CUBRID current charset: %s\n", cubrid_client_encoding($con));
?>
]]>
@ -86,22 +64,21 @@ cubrid_disconnect($conn);
&example.outputs;
<screen>
<![CDATA[
CUBRID PHP Version: 8.3.1.0005
PARAM_ISOLATION_LEVEL 3
LOCK_TIMEOUT -1
MAX_STRING_LENGTH 1073741823
PARAM_AUTO_COMMIT 0
Server Info: 8.3.1.0173
Client Info: 8.3.1
CUBRID Charset: iso8859-1
CUBRID current charset: iso8859-1
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>cubrid_client_encoding</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file