1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
|
<?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
-->
|