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

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@191009 c90b9560-bf6c-de11-be94-00142212c4b1
101 lines
3 KiB
XML
101 lines
3 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.5 $ -->
|
|
<!-- splitted from ./en/functions/ingres_ii.xml, last change in rev 1.1 -->
|
|
<refentry id="function.ingres-connect">
|
|
<refnamediv>
|
|
<refname>ingres_connect</refname>
|
|
<refpurpose>
|
|
Open a connection to an Ingres II database
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<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>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns a Ingres II link resource on success, or &false; on
|
|
failure.
|
|
</para>
|
|
<para>
|
|
<function>ingres_connect</function> opens a connection with the
|
|
Ingres database designated by <parameter>database</parameter>,
|
|
which follows the syntax
|
|
<parameter>[node_id::]dbname[/svr_class]</parameter>.
|
|
</para>
|
|
<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>
|
|
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>
|
|
<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>
|
|
<para> See also
|
|
<function>ingres_pconnect</function> and
|
|
<function>ingres_close</function>.
|
|
</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
|
|
-->
|