PHP Velho Oeste 2024

ifx_connect

(PHP 4, PHP 5 < 5.2.1)

ifx_connectAbrir conexión con el servidor Informix

Descripción

ifx_connect ([ string $database [, string $userid [, string $password ]]] ) : resource

ifx_connect() establece una conexión con un servidor Informix.

En este caso se hace una segunda llamada a ifx_connect() con los mismos argumentos, no se abrirá nuevo enlace, pero en su lugar. El identificador de enlace ya abierto será devuelto.

El enlace al servidor será cerrado tan pronto como la ejecución del script termine, a menos que sea cerrado llamando a explícitamente a ifx_close().

Parámetros

Todos los argumentos son opcionales, y si alguno falta, por defecto se toman los valores proporcionados en el php.ini (ifx.default_host para el host (La libreria usará el valor de entorno INFORMIXSERVER si no está definido), ifx.default_user para el usuario, ifx.default_password para la contraseña (ninguna si no está definida).

database

El nombre de la base de datos, como un string.

userid

El usuario, como un string.

password

La contraseña, como un string.

Valores devueltos

Devuelve un identificador de conexión en caso de éxito, o FALSE en caso de error.

Ejemplos

Ejemplo #1 Conectarse a una base de datos Informix

<?php
$conn_id 
ifx_connect ("mydb@ol_srv1""imyself""mypassword");
?>

Ver también

add a note add a note

User Contributed Notes 2 notes

up
1
mohd dot chehab at e-medlinks dot com
13 years ago
Here's a tip :

When i first installed the informix through the removing the ; at php_ifx.dll and then restarted apache

then checking the phpinfo(); the connection wasn't established and i had this error that i have to set the INFORMIXSERVER.

Work Frame : Windows XP,Apache 2.2.1 php 5.3 The ODBC was working fine and i could connect to the informix server using the odbc connection

The problem is that the sql engine was on another machine with different platform.

[SOLUTION]

add an environmental variable called INFORMIXSERVER with the value of the server e.g myInformixServer which itself has an ip 192.x.x.x

You can do that on windows by right click on my computer advanced >> environmental variables >> add new System variable >> variable name = INFORMIXSERVER 
variable value = myInformixServer

it worked like a charm
up
-2
bernd dot newman at t-online dot de
21 years ago
Problem with INFORMIX-Access with PHP4, WIN NT 4.0?

1. php.ini: extension=php_ifx.dll
2. Path: Informix/BIN
3. httpd.conf: PassEnv INFORMIXSERVER
                    PassEnv INFORMIXDIR
4. use the Informix-tool regcopy.exe to copy the registry settings in the system-account.

good luck!
To Top