PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<ingres_commitingres_fetch_array>
Last updated: Mon, 16 Jul 2012

ingres_connect

(PHP 4 >= 4.0.2, PHP 5)

ingres_connect --  Open a connection to an Ingres II database

Description

resource ingres_connect ( [string database [, string username [, string password]]] )

警告

本函数是实验性的。本函数的行为,包括函数名称以及其它任何关于本函数的文档可能会在没有通知的情况下随 PHP 以后的发布而改变。使用本函数风险自担。

Returns a Ingres II link resource on success, or FALSE on failure.

ingres_connect() opens a connection with the Ingres database designated by database, which follows the syntax [node_id::]dbname[/svr_class].

If some parameters are missing, ingres_connect() uses the values in php.ini for ingres.default_database, ingres.default_user, and ingres.default_password.

The connection is closed when the script ends or when ingres_close() is called on this link.

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.

例子 1. ingres_connect() example

<?php
   $link
= ingres_connect("mydb", "user", "pass")
       or die(
"Could not connect");
   echo
"Connected successfully";
  
ingres_close($link);
?>

例子 2. ingres_connect() example using default link

<?php
   ingres_connect
("mydb", "user", "pass")
       or die(
"Could not connect");
   echo
"Connected successfully";
  
ingres_close();
?>

See also ingres_pconnect() and ingres_close().




<ingres_commitingres_fetch_array>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST