mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-29 23:38:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301868 c90b9560-bf6c-de11-be94-00142212c4b1
123 lines
3.7 KiB
XML
123 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- $Revision$ -->
|
||
|
||
<refentry xml:id="function.cubrid-connect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||
<refnamediv>
|
||
<refname>cubrid_connect</refname>
|
||
<refpurpose>Is used to establish the environment for connecting to your server </refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis>
|
||
<type>int</type><methodname>cubrid_connect</methodname>
|
||
<methodparam><type>string</type><parameter>host</parameter></methodparam>
|
||
<methodparam><type>int</type><parameter>port</parameter></methodparam>
|
||
<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>
|
||
</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.
|
||
</para>
|
||
<para>
|
||
Calling the <function>cubrid_connect</function> function does not necessarily make the connection to your server. The actual connection will be made when an operation is requested by using the connection handle.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>host</parameter></term>
|
||
<listitem><para>Host name of CAS server.</para></listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>port</parameter></term>
|
||
<listitem><para>Port number of CAS server.</para></listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>dbname</parameter></term>
|
||
<listitem><para>Name of database.</para></listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>userid</parameter></term>
|
||
<listitem><para>User name for the database.</para></listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>passwd</parameter></term>
|
||
<listitem><para>User password.</para></listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
Connection handle, when process is successful.
|
||
</para>
|
||
<para>
|
||
&false;, when process is unsuccessful.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<example>
|
||
<title><function>cubrid_connect</function> example</title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
$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);
|
||
}
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
</example>
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><function>cubrid_disconnect</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
|
||
-->
|