php-doc-en/reference/ingres-ii/functions/ingres-connect.xml
Hannes Magnusson c030e2adf7 Upgrade to DocBook5:
- All id attributes are now xml:id
 - Add docbook namespace to all root elements
 - Replace <ulink /> with <link xlink:href />
 - Minor markup fixes here and there


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@238160 c90b9560-bf6c-de11-be94-00142212c4b1
2007-06-20 22:25:43 +00:00

298 lines
10 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<refentry xml:id="function.ingres-connect" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ingres_connect</refname>
<refpurpose>Open a connection to an Ingres database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>ingres_connect</methodname>
<methodparam choice="opt"><type>string</type><parameter>database</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>password</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
<function>ingres_connect</function> opens a connection with the
given Ingres <parameter>database</parameter>.
</para>
<para>
The connection is closed when the script ends or when
<function>ingres_close</function> is called on this link.
</para>
<para>
All the other ingres functions use the last opened link as a
default, so you need to store the returned value only if you use
more than one link at a time.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
If some parameters are missing, <function>ingres_connect</function>
uses the values in &php.ini; for
<parameter>ingres.default_database</parameter>,
<parameter>ingres.default_user</parameter> and
<parameter>ingres.default_password</parameter>.
</para>
<para>
<variablelist>
<varlistentry>
<term><parameter>database</parameter></term>
<listitem>
<para>
The database name. Must follows the syntax
<varname>[node_id::]dbname[/svr_class]</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>username</parameter></term>
<listitem>
<para>
The Ingres user name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>password</parameter></term>
<listitem>
<para>
The password associated with <parameter>username</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
<function>ingres_connect</function> options
<informaltable>
<tgroup cols='2'>
<thead>
<row>
<entry>Option name</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>date_century_boundary</entry>
<entry>The threshold by which a 2 digit year is determined to be in
the current century or in the next century. Equivalent to II_DATE_CENTURY_BOUNDARY. </entry>
</row>
<row>
<entry>group</entry>
<entry>Speficfies the group ID of the user, equivalent to the '-G'
flag</entry>
</row>
<row>
<entry>role</entry>
<entry>The role ID of the application. If a role password is
required, the parameter value should be specified as "role/password"</entry>
</row>
<row>
<entry>effective_user</entry>
<entry>The ingres user account being impersonated, equivalent to the '-u' flag</entry>
</row>
<row>
<entry>dbms_password</entry>
<entry>The internal database password for the user connecting to Ingres</entry>
</row>
<row>
<entry>table_structure</entry>
<entry><para>
The default structure for new tables.
Valid values for table_structure are:
<itemizedlist>
<listitem><simpara>INGRES_STRUCTURE_BTREE</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_HASH</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_HEAP</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_ISAM</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_CBTREE</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_CISAM</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_CHASH</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_CHEAP</simpara></listitem>
</itemizedlist>
</para>
</entry>
</row>
<row>
<entry>index_structure</entry>
<entry><para>
The default structure for new secondary indexes. Valid values
for index_structure are:
<itemizedlist>
<listitem><simpara>INGRES_STRUCTURE_CBTREE</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_CISAM</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_CHASH</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_BTREE</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_HASH</simpara></listitem>
<listitem><simpara>INGRES_STRUCTURE_ISAM</simpara></listitem>
</itemizedlist>
</para>
</entry>
</row>
<row>
<entry>login_local</entry>
<entry>Determines how the connection user ID and password are
used when a VNODE is included in the target database string.
If set to TRUE, the user ID and password are used to locally access
the VNODE and the VNODE login information is used to establish the DBMS
connection. If set to FALSE, the process user ID is used to access
the VNODE and the connection user ID and password are used in place
of the VNODE login information to establish the DBMS connection.
This parameter is ignored if no VNODE is included in the target
database string. The default is FALSE.</entry>
</row>
<row>
<entry>timezone</entry>
<entry>Controls the timezone of the session. If not set it will
default the the value defined by II_TIMEZONE_NAME. If
II_TIMEZONE_NAME is not defined the NA-PACIFIC (GMT-8 with Daylight
Savings) is used.</entry>
</row>
<row>
<entry>date_format</entry>
<entry><para>Sets the allowable input and output format for Ingres dates.
Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
not set the default date format is US, e.g. mm/dd/yy. Valid values
for date_format are:
<itemizedlist>
<listitem><simpara>INGRES_DATE_DMY</simpara></listitem>
<listitem><simpara>INGRES_DATE_FINISH</simpara></listitem>
<listitem><simpara>INGRES_DATE_GERMAN</simpara></listitem>
<listitem><simpara>INGRES_DATE_ISO</simpara></listitem>
<listitem><simpara>INGRES_DATE_ISO4</simpara></listitem>
<listitem><simpara>INGRES_DATE_MDY</simpara></listitem>
<listitem><simpara>INGRES_DATE_MULTINATIONAL</simpara></listitem>
<listitem><simpara>INGRES_DATE_MULTINATIONAL4</simpara></listitem>
<listitem><simpara>INGRES_DATE_YMD</simpara></listitem>
<listitem><simpara>INGRES_DATE_US</simpara></listitem>
</itemizedlist>
</para>
</entry>
</row>
<row>
<entry>decimal_separator</entry>
<entry>The character identifier for decimal data</entry>
</row>
<row>
<entry>money_lort</entry>
<entry><para>Leading or trailing currency sign. Valid values for money_lort
are:
<itemizedlist>
<listitem><simpara>INGRES_MONEY_LEADING</simpara></listitem>
<listitem><simpara>INGRES_MONEY_TRAILING</simpara></listitem>
</itemizedlist>
</para>
</entry>
</row>
<row>
<entry>money_sign</entry>
<entry>The currency symbol to be used with the MONEY datatype</entry>
</row>
<row>
<entry>money_precision</entry>
<entry>The precision of the MONEY datatype</entry>
</row>
<row>
<entry>float4_precision</entry>
<entry>Precision of the FLOAT4 datatype</entry>
</row>
<row>
<entry>float8_precision</entry>
<entry>Precision of the FLOAT8 data</entry>
</row>
<row>
<entry>blob_segment_length</entry>
<entry>The amount of data in bytes to fetch at a time when retrieving
BLOB/CLOB data, defaults to 4096 bytes when not explicitly set.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a Ingres link resource on success, or &false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>ingres_connect</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$link = ingres_connect("mydb", "user", "pass")
or die("Could not connect");
echo "Connected successfully";
ingres_close($link);
?>
]]>
</programlisting>
</example>
<example>
<title>
<function>ingres_connect</function> example using default link
</title>
<programlisting role="php">
<![CDATA[
<?php
ingres_connect("mydb", "user", "pass")
or die("Could not connect");
echo "Connected successfully";
ingres_close();
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ingres_pconnect</function></member>
<member><function>ingres_close</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:"../../../../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
-->