mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-29 15:28:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301868 c90b9560-bf6c-de11-be94-00142212c4b1
132 lines
5 KiB
XML
132 lines
5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<refentry xml:id="function.cubrid-execute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>cubrid_execute</refname>
|
|
<refpurpose>Is used to execute the given SQL sentence.</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>cubrid_execute</methodname>
|
|
<methodparam><type>int</type><parameter>conn_handle</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>SQL</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>option</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>cubrid_execute</methodname>
|
|
<methodparam><type>int</type><parameter>request_handle</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>option</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
The <function>cubrid_execute</function> function is used to execute the given SQL sentence. It executes the query by using <parameter>conn_handle</parameter> and SQL, and then returns the request handle created. It is used for simple execution of query, where the parameter binding is not needed. In addition, the <function>cubrid_execute</function> function is used to execute the prepared statement by means of <function>cubrid_prepare</function> and <function>cubrid_bind</function>. At this time, you need to specify arguments of <parameter>request_handle</parameter> and <parameter>option</parameter>.
|
|
</para>
|
|
<para>
|
|
You can use the <parameter>option</parameter> argument to tell whether to receive oid of the row after the execution, and, whether to execute the query in asynchronous mode. You can use it by setting the CUBRID_INCLUDE_OID and CUBRID_ASYNC using bitwise or operator. If the both variables are not explicitly given, they are not selected by default.
|
|
</para>
|
|
<para>
|
|
If the first argument is <parameter>request_handle</parameter> to execute the <function>cubrid_prepare</function> function, you can specify an option, CUBRID_ASYNC only.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>conn_handle</parameter></term>
|
|
<listitem><para>Connection handle.</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>SQL</parameter></term>
|
|
<listitem><para>SQL to be executed.</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>option</parameter></term>
|
|
<listitem><para>Query execution option CUBRID_INCLUDE_OID, CUBRID_ASYNC.</para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>request_handle</parameter></term>
|
|
<listitem><para><function>cubrid_prepare</function> handle.</para></listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Request handle, when process is successful.
|
|
</para>
|
|
<para>
|
|
&false;, when process is unsuccessful.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title><function>cubrid_execute</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$con = cubrid_connect ("dbsvr.cubrid.com", 33000, "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_request ($req); } cubrid_disconnect ($con);
|
|
} $con = cubrid_connect ("dbsvr.cubrid.com", 33000, "demodb");
|
|
if ($con) { echo "connected successfully";
|
|
$sql = "insert into tbl values ( ?,?,?)"; $req = cubrid_prepare( $con, $sql, CUBRID_INCLUDE_OID );
|
|
$i = 0;
|
|
while ( $i < 2 ) {
|
|
$res = cubrid_bind( $req, 1, "1", "NUMBER");
|
|
$res = cubrid_bind( $req, 2, "2");
|
|
$res = cubrid_bind( $req, 3, "04:22:34 PM 08/07/2007");
|
|
$res = cubrid_execute( $req );
|
|
$i = $i + 1;
|
|
}}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>cubrid_close_request</function></member>
|
|
<member><function>cubrid_commit</function></member>
|
|
<member><function>cubrid_rollback</function></member>
|
|
<member><function>cubrid_prepare</function></member>
|
|
<member><function>cubrid_bind</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|