Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Ingres II Functions : ingres_connect

ingres_connect

Open a connection to an Ingres database (PHP 4 >= 4.0.2, PHP 5 <= 5.0.5, PECL ingres:1.0-1.4.3)
resource ingres_connect ( [string database [, string username [, string password [, array options]]]] )

ingres_connect() opens a connection with the given Ingres database.

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.

Parameters

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

database

The database name. Must follows the syntax [node_id::]dbname[/svr_class].

username

The Ingres user name.

password

The password associated with username.

options

ingres_connect() options

Option name Description
date_century_boundary 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.
group Speficfies the group ID of the user, equivalent to the '-G' flag
role The role ID of the application. If a role password is required, the parameter value should be specified as "role/password"
effective_user The ingres user account being impersonated, equivalent to the '-u' flag
dbms_password The internal database password for the user connecting to Ingres
table_structure

The default structure for new tables. Valid values for table_structure are:

  • INGRES_STRUCTURE_BTREE
  • INGRES_STRUCTURE_HASH
  • INGRES_STRUCTURE_HEAP
  • INGRES_STRUCTURE_ISAM
  • INGRES_STRUCTURE_CBTREE
  • INGRES_STRUCTURE_CISAM
  • INGRES_STRUCTURE_CHASH
  • INGRES_STRUCTURE_CHEAP
index_structure

The default structure for new secondary indexes. Valid values for index_structure are:

  • INGRES_STRUCTURE_CBTREE
  • INGRES_STRUCTURE_CISAM
  • INGRES_STRUCTURE_CHASH
  • INGRES_STRUCTURE_BTREE
  • INGRES_STRUCTURE_HASH
  • INGRES_STRUCTURE_ISAM
login_local 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.
timezone 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.
date_format

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:

  • INGRES_DATE_DMY
  • INGRES_DATE_FINISH
  • INGRES_DATE_GERMAN
  • INGRES_DATE_ISO
  • INGRES_DATE_ISO4
  • INGRES_DATE_MDY
  • INGRES_DATE_MULTINATIONAL
  • INGRES_DATE_MULTINATIONAL4
  • INGRES_DATE_YMD
  • INGRES_DATE_US
decimal_separator The character identifier for decimal data
money_lort

Leading or trailing currency sign. Valid values for money_lort are:

  • INGRES_MONEY_LEADING
  • INGRES_MONEY_TRAILING
money_sign The currency symbol to be used with the MONEY datatype
money_precision The precision of the MONEY datatype
float4_precision Precision of the FLOAT4 datatype
float8_precision Precision of the FLOAT8 data
blob_segment_length The amount of data in bytes to fetch at a time when retrieving BLOB/CLOB data, defaults to 4096 bytes when not explicitly set.

Return Values

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

Examples

Example 1083. ingres_connect() example

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


Example 1084.  ingres_connect() example using default link

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


Code Examples / Notes » ingres_connect

tdjunk

You need to connect with the user running your web server, be it apache, nobody, or system (on MS Windows). Hence you have to create a matching (username) Ingres user.
Otherwise you may experience an Ingres Error :
790536 : Unable to authenticate client's user ID.
See more information on the community forum : http://community.ingres.com/forums/viewtopic.php?t=1370


Change Language


Follow Navioo On Twitter
ingres_autocommit
ingres_close
ingres_commit
ingres_connect
ingres_cursor
ingres_errno
ingres_error
ingres_errsqlstate
ingres_fetch_array
ingres_fetch_object
ingres_fetch_row
ingres_field_length
ingres_field_name
ingres_field_nullable
ingres_field_precision
ingres_field_scale
ingres_field_type
ingres_num_fields
ingres_num_rows
ingres_pconnect
ingres_query
ingres_rollback
eXTReMe Tracker