php-doc-en/reference/ingres-ii/functions/ingres-connect.xml
2011-09-30 14:21:51 +00:00

314 lines
12 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<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>
</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 follow the syntax:
</para>
<para>
<varname>[vnode::]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 xml:id="function.ingres-connect.options">
<term><parameter>options</parameter></term>
<listitem>
<para>
<function>ingres_connect</function> options
<informaltable>
<tgroup cols="4">
<thead>
<row valign="top">
<entry>Option name</entry>
<entry>Option type</entry>
<entry>Description</entry>
<entry>Example</entry>
</row>
</thead>
<tbody>
<row valign="top">
<entry>date_century_boundary</entry>
<entry><type>integer</type></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>
<entry>50</entry>
</row>
<row valign="top">
<entry>group</entry>
<entry><type>string</type></entry>
<entry>Specifies the group ID of the user, equivalent to the "-G"
flag</entry>
<entry>payroll</entry>
</row>
<row valign="top">
<entry>role</entry>
<entry><type>string</type></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 valign="top">
<entry>effective_user</entry>
<entry><type>string</type></entry>
<entry>The ingres user account being impersonated, equivalent to the "-u" flag</entry>
<entry>another_user</entry>
</row>
<row valign="top">
<entry>dbms_password</entry>
<entry><type>string</type></entry>
<entry>The internal database password for the user connecting to Ingres</entry>
<entry>s3cr3t</entry>
</row>
<row valign="top">
<entry>table_structure</entry>
<entry><type>string</type></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>
<entry>INGRES_STRUCTURE_BTREE</entry>
</row>
<row valign="top">
<entry>index_structure</entry>
<entry><type>string</type></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>
<entry>INGRES_STRUCTURE_HASH</entry>
</row>
<row valign="top">
<entry>login_local</entry>
<entry><type>boolean</type></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>
<entry>TRUE</entry>
</row>
<row valign="top">
<entry>timezone</entry>
<entry><type>string</type></entry>
<entry>Controls the timezone of the session. If not set it will
default to the value defined by II_TIMEZONE_NAME. If
II_TIMEZONE_NAME is not defined, NA-PACIFIC (GMT-8 with Daylight
Savings) is used.</entry>
</row>
<row valign="top">
<entry>date_format</entry>
<entry><type>integer</type></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>
<entry>INGRES_DATE_MULTINATIONAL4</entry>
</row>
<row valign="top">
<entry>decimal_separator</entry>
<entry><type>string</type></entry>
<entry>The character identifier for decimal data</entry>
<entry>","</entry>
</row>
<row valign="top">
<entry>money_lort</entry>
<entry><type>integer</type></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>
<entry>INGRES_MONEY_TRAILING</entry>
</row>
<row valign="top">
<entry>money_sign</entry>
<entry><type>string</type></entry>
<entry>The currency symbol to be used with the MONEY datatype</entry>
<entry></entry>
</row>
<row valign="top">
<entry>money_precision</entry>
<entry><type>integer</type></entry>
<entry>The precision of the MONEY datatype</entry>
<entry>3</entry>
</row>
<row valign="top">
<entry>float4_precision</entry>
<entry><type>integer</type></entry>
<entry>Precision of the FLOAT4 datatype</entry>
<entry>10</entry>
</row>
<row valign="top">
<entry>float8_precision</entry>
<entry><type>integer</type></entry>
<entry>Precision of the FLOAT8 data</entry>
<entry>10</entry>
</row>
<row valign="top">
<entry>blob_segment_length</entry>
<entry><type>integer</type></entry>
<entry>The amount of data in bytes to fetch at a time when retrieving
BLOB or CLOB data, defaults to 4096 bytes when not explicitly set</entry>
<entry>8192</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a Ingres link resource on success&return.falseforfailure;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Open a connection to an Ingres database</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>
</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:"~/.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
-->