>PHP: Funciones de Informix - Manual

MANUAL DE PHP

(y algo mas)windsurf pozo izquierdo
Google
search for in the  
ELMARRAJO.COM mysql bulma desarrollo web linux fedora html ayuda

windsurf mercedes camper

LX. Funciones de Informix

Introducción

El controlador de Informix para Informix (IDS) 7.x, SE 7.x, Universal Server (IUS) 9.x y IDS 2000 es implementado en "ifx.ec" y "php3_ifx.h" en el directorio de la extensión informix. El soporte para IDS 7.x es razonablemente completo, con soporte para columnas BYTE y TEXT. El soporte para IUS 9.x se encuentra parcialmente terminado: los nuevos tipos de datos se encuentran allí, pero el soporte para SLOB y CLOB aun está en construcción

Requisitos

Notas de configuración: Necesita alguna versión de ESQL/C para compilar el controlador para Informix de PHP. Las versiones de ESQL/C a partir de 7.2x deben trabajar bien. ESQL/C es ahora parte del SDK de Cliente de Informix.

Asegúrese de que la variable "INFORMIXDIR" haya sido definida, y de que $INFORMIXDIR/bin se encuentre en su PATH antes de ejecutar el script "configure".

Instalación

Para poder utilizar estas funciones, se debe compilar PHP con la opción de compilación --with-informix[=DIR], donde DIR es el directorio base de la instalación de Informix, y cuyo valor no se establece por defecto.

Configuración en tiempo de ejecución

El comportamiento de estas funciones está afectado por los valores definidos en php.ini.

Nota: Make sure that the Informix environment variables INFORMIXDIR and INFORMIXSERVER are available to the PHP ifx driver, and that the INFORMIX bin directory is in the PATH. Check this by running a script that contains a call to phpinfo() before you start testing. The phpinfo() output should list these environment variables. This is true for both CGI php and Apache mod_php. You may have to set these environment variables in your Apache startup script.

The Informix shared libraries should also be available to the loader (check LD_LIBRARY_PATH or ld.so.conf/ldconfig).

Some notes on the use of BLOBs (TEXT and BYTE columns): BLOBs are normally addressed by BLOB identifiers. Select queries return a "blob id" for every BYTE and TEXT column. You can get at the contents with "string_var = ifx_get_blob($blob_id);" if you choose to get the BLOBs in memory (with: "ifx_blobinfile(0);"). If you prefer to receive the content of BLOB columns in a file, use "ifx_blobinfile(1);", and "ifx_get_blob($blob_id);" will get you the filename. Use normal file I/O to get at the blob contents.

For insert/update queries you must create these "blob id's" yourself with "ifx_create_blob();". You then plug the blob id's into an array, and replace the blob columns with a question mark (?) in the query string. For updates/inserts, you are responsible for setting the blob contents with ifx_update_blob().

The behaviour of BLOB columns can be altered by configuration variables that also can be set at runtime:

configuration variable: ifx.textasvarchar

configuration variable: ifx.byteasvarchar

runtime functions:

ifx_textasvarchar(0): use blob id's for select queries with TEXT columns

ifx_byteasvarchar(0): use blob id's for select queries with BYTE columns

ifx_textasvarchar(1): return TEXT columns as if they were VARCHAR columns, so that you don't need to use blob id's for select queries.

ifx_byteasvarchar(1): return BYTE columns as if they were VARCHAR columns, so that you don't need to use blob id's for select queries.

configuration variable: ifx.blobinfile

runtime function:

ifx_blobinfile_mode(0): return BYTE columns in memory, the blob id lets you get at the contents.

ifx_blobinfile_mode(1): return BYTE columns in a file, the blob id lets you get at the file name.

If you set ifx_text/byteasvarchar to 1, you can use TEXT and BYTE columns in select queries just like normal (but rather long) VARCHAR fields. Since all strings are "counted" in PHP, this remains "binary safe". It is up to you to handle this correctly. The returned data can contain anything, you are responsible for the contents.

If you set ifx_blobinfile to 1, use the file name returned by ifx_get_blob(..) to get at the blob contents. Note that in this case YOU ARE RESPONSIBLE FOR DELETING THE TEMPORARY FILES CREATED BY INFORMIX when fetching the row. Every new row fetched will create new temporary files for every BYTE column.

The location of the temporary files can be influenced by the environment variable "blobdir", default is "." (the current directory). Something like: putenv(blobdir=tmpblob"); will ease the cleaning up of temp files accidentally left behind (their names all start with "blb").

Automatically trimming "char" (SQLCHAR and SQLNCHAR) data: This can be set with the configuration variable

ifx.charasvarchar: if set to 1 trailing spaces will be automatically trimmed, to save you some "chopping".

NULL values: The configuration variable ifx.nullformat (and the runtime function ifx_nullformat()) when set to TRUE will return NULL columns as the string "NULL", when set to FALSE they return the empty string. This allows you to discriminate between NULL columns and empty columns.

Tabla 1. Informix configuration options

NameDefaultChangeableChangelog
ifx.allow_persistent"1"PHP_INI_SYSTEM 
ifx.max_persistent"-1"PHP_INI_SYSTEM 
ifx.max_links"-1"PHP_INI_SYSTEM 
ifx.default_hostNULLPHP_INI_SYSTEM 
ifx.default_userNULLPHP_INI_SYSTEM 
ifx.default_passwordNULLPHP_INI_SYSTEM 
ifx.blobinfile"1"PHP_INI_ALL 
ifx.textasvarchar"0"PHP_INI_ALL 
ifx.byteasvarchar"0"PHP_INI_ALL 
ifx.charasvarchar"0"PHP_INI_ALL 
ifx.nullformat"0"PHP_INI_ALL 
For further details and definitions of the PHP_INI_* constants, see the Apéndice G.

A continuación se presenta una corta explicación de las directivas de configuración.

ifx.allow_persistent boolean

Whether to allow persistent Informix connections.

ifx.max_persistent integer

The maximum number of persistent Informix connections per process.

ifx.max_links integer

The maximum number of Informix connections per process, including persistent connections.

ifx.default_host string

The default host to connect to when no host is specified in ifx_connect() or ifx_pconnect(). Doesn't apply in safe mode.

ifx.default_user string

The default user id to use when none is specified in ifx_connect() or ifx_pconnect(). Doesn't apply in safe mode.

ifx.default_password string

The default password to use when none is specified in ifx_connect() or ifx_pconnect(). Doesn't apply in safe mode.

ifx.blobinfile boolean

Set to TRUE if you want to return blob columns in a file, FALSE if you want them in memory. You can override the setting at runtime with ifx_blobinfile_mode().

ifx.textasvarchar boolean

Set to TRUE if you want to return TEXT columns as normal strings in select statements, FALSE if you want to use blob id parameters. You can override the setting at runtime with ifx_textasvarchar().

ifx.byteasvarchar boolean

Set to TRUE if you want to return BYTE columns as normal strings in select queries, FALSE if you want to use blob id parameters. You can override the setting at runtime with ifx_textasvarchar().

ifx.charasvarchar boolean

Set to TRUE if you want to trim trailing spaces from CHAR columns when fetching them.

ifx.nullformat boolean

Set to TRUE if you want to return NULL columns as the literal string "NULL", FALSE if you want them returned as the empty string "". You can override this setting at runtime with ifx_nullformat().

Constantes predefinidas

Esta extensión no tiene ninguna constante definida.

Tabla de contenidos
ifx_affected_rows -- Obtiene el número de registros procesados por una consulta
ifx_blobinfile_mode -- Define el modo por defecto para los blob en todas las consultas de selección
ifx_byteasvarchar -- Define el modo por defecto para los campos de tipo byte
ifx_close -- Cierra una conexión con Informix
ifx_connect -- Abrir una conexión con un servidor Informix
ifx_copy_blob -- Duplica el objeto blob dado
ifx_create_blob -- Crea un objeto blob
ifx_create_char -- Crea un objeto char
ifx_do -- Ejecuta una sentencia SQL preparada previamente
ifx_error -- Devuelve el código de error de la última llamada a Informix
ifx_errormsg -- Devuelve el mensaje de error de la última llamada a Informix
ifx_fetch_row -- Obtiene registros como un array (vector) enumerado
ifx_fieldproperties -- Indica las propiedades de los campos de una consulta SQL
ifx_fieldtypes -- Obtiene los campos de una consulta SQL
ifx_free_blob -- Borra el objeto blob
ifx_free_char -- Elimina un objeto char
ifx_free_result -- Libera los recursos de una consulta
ifx_get_blob -- Obtiene el contenido de un objeto blob
ifx_get_char -- Obtiene el contenido de un objeto char
ifx_getsqlca -- Después de una consulta, obtiene el contenido de sqlca.sqlerrd[0..5]
ifx_htmltbl_result -- Muestra todos los registros de una consulta en una tabla HTML
ifx_nullformat -- Define el valor por defecto cuando se leen valores nulos
ifx_num_fields -- Devuelve el número de columnas en una consulta
ifx_num_rows -- Cuenta los registros ya leídos de una consulta
ifx_pconnect -- Abre una conexión permanente con Informix
ifx_prepare -- Preparar una sentencia-SQL para su ejecución
ifx_query -- Enviar una consulta Informix
ifx_textasvarchar -- Define el modo por defecto para los campos de tipo text
ifx_update_blob -- Actualiza el contenido de un objeto blob
ifx_update_char -- Actualiza el contenido de un objeto char
ifxus_close_slob -- Cierra un objeto slob
ifxus_create_slob -- Crea un objeto slob y lo abre
ifxus_free_slob -- Elimina un objeto slob
ifxus_open_slob -- Abre un objeto slob
ifxus_read_slob -- Lee un número de bytes (nbytes) de un objeto slob
ifxus_seek_slob -- Establece la posición de archivo o búsqueda actual
ifxus_tell_slob -- Devuelve la posición de archivo o búsqueda actual
ifxus_write_slob -- Escribe una cadena en un objeto slob


add a note add a note User Contributed Notes
Funciones de Informix
Ian McMurray
15-Apr-2005 01:02
Installation on RedHat Fedore Core (or in that matter any Linux OS which has a version of glibc  of 2.3.* ~or above~) will need to have the latest Informix CSDK (downloadable from IBM). 2.90.UC1.LINUX at the time of this post.

http://www-306.ibm.com/software/data/informix/tools/connect/

I was unable to make PHP with v2.80 of the csdk (as it complained about mktemp being dangerous and how ctype was undefined. After downloading csdk 2.90, I was able to make PHP with no problems at all. (--with-informix).

There goes 2 days of my life!

Feel free to drop me an email at ian_at_devtonic_dot_com if you have any questions.
drsound
31-Oct-2004 10:20
I just wrote a mini-HOWTO about adding Informix support to mod_php running on a Gentoo Linux server (x86). I wanted to post it here but it was too long. You can find it on http://forums.gentoo.org/viewtopic.php?t=245249 (just in case for some reason they change the thread number, the title is "HOWTO: PHP Informix client support").
jeff at domintcom dot com
26-Oct-2002 11:06
add the following to /etc/profile (right before unset i (adjust to your needs)

export INFORMIXDIR=/opt/informix
export ODBCINI=/usr/local/etc/odbc.ini
export INFORMIXSERVER=m_srv

then add the following to your httpd.conf

PassEnv INFORMIXDIR
PassEnv ODBCINI
PassEnv INFORMIXSERVER

(or you can use SetEnv SetEnv INFORMIXDIR /opt/informix  etc.)
cornecNOSPAM at reach dot NO_SPAM dot com
15-Oct-2002 08:14
I upgraded to csdk-2.70.UC3-1 and got the following error when trying to start apache:

Syntax error on line 205 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server: /opt/informix/lib/esql/libifgen.so: undefined symbol: stat
/usr/local/apache/bin/apachectl start: httpd could not be started

This machine has glibc 2.3.5

The following fixed the problem for me (surely there's a better fix) but i'm not sure how it might affect other programs linked to libifgen

mkdir /tmp/ifx
cd /tmp/ifx
ar x $INFORMIXDIR/lib/esql/libifgen.a
gcc -shared -o libifgen.so *.o
cp libifgen.so $INFORMIXDIR/lib/esql
programacion at afinformatica dot com
27-May-2002 07:38
I have compile php-4.0.6 with informix support (dynamic) and when I try to
start apache, it gives me this error message:

Syntax error on line 246 of /etc/httpd/httpd.conf:
Cannot load /usr/lib/apache/libphp4.so into server: /home/informix7/lib/esql/lib
ifgen.so: undefined symbol: stat
/usr/sbin/apachectl start: httpd could not be started
isaac dot hopley at morton-fraser dot NO_SPAM dot com
15-Nov-2001 04:54
If you are tring to access an Informix Online 5.x server over the
network (ie from a webserver) using PHP, be aware that Online
doesn't support network communications as standard unlike later versions.

You need the Informix product 'I-Star' on your Online server.
This will allow your webserver with the informix client SDK
installed to communicate natively (ESQL).

Thanks go to Mario @ PRS for this info.
old dot wolf at project-w dot com
26-Jul-2001 11:40
An intermittent SQL error -25580 is caused by using the wrong glibc version in Linux.

I have this working correctly in Linux (x86) with Informix Client SDK for 2.70UC-1 for Linux, with glibc 2.1.3.

Originally I had glibc 2.1.1 (Red Hat 6), which gave the intermittent error, but upgrading glibc fixed it.

The Informix Client SDKs can be downloaded from www.informix.com (you need to own an Informix database to log on), and glibc is at ftp://ftp.gnu.org/gnu/glibc .
MarkRoedel at letu dot edu
02-Mar-2001 04:19
There's also a FreeBSD version of the client libraries that'll work with PHP.  It's not available for download from their website, but you can request a copy (cd or electronic delivery) by calling Informix Customer Support at 1-800-274-8184 option 3.

Some customer service reps know more about alternative operating systems than others, so you may have to do a bit of educating before they can locate the product in their database, but it's definitely there.

My e-mail confirmation referred to it as "Orderable Part Number 100-15871-204057-1", although that number may be specific to the electronically-delivered edition.
robernet at music-images dot com
26-Sep-2000 07:29
Verify with phpinfo() that you have informix module compiled in php.
Also verify that env vars INFORMIXDIR, INFORMIXSERVER, LD_LIBRARY_PATH are set, and that PATH have a route to your informix subdir.

Citas célebres

La Navidad en mi casa es por lo menos seis o siete veces más agradable que en cualquier otro sitio. Empezamos a beber temprano, y cuando el resto de la gente ve un solo Santa Claus, nosotros vemos seis o siete.

W. C. Fields
Actor estadounidense
(1880-1946)
Citas en tu mail
©Contenidos Gratis

Ilusiones Opticas
ilusion_optica_038.jpg
Contenidos Web

Chiste de... Varios
El sermón

El cura, visiblemente cabreado, dice al final del sermón:

- Y no olvidéis feligreses, que el señor acepta lo que sea, con tal de que se le dé con buena voluntad, pero también recibe lo que se da a regañadientes.
Chistes en tu mail
©ContenidosGratis

Humor Gráfico
humor_grafico_049.jpg
Contenidos Web

Inicio | Acción | Estrategia | Palabras | Puzzles | Solitarios | Foro Trucos
Cake ManiaCake Mania
Jugadores: 6835
Categoría del juego: Acción
Objetivo del juego: Ayuda a Jill a recuperar la pastelería de su abuela llevando su propia pastelería; consigue clientes y gana dinero.
Rainbow WebRainbow Web
Jugadores: 2199
Categoría del juego: Puzzles
Objetivo del juego: Rompe un pegajoso hechizo y salva un reino de fantasía en Rainbow Web. Tendrás toneladas de diversión mientras juegas a este mágico desafío para la mente.
Mahjongg FortunaMahjongg Fortuna
Jugadores: 12462
Categoría del juego: Solitarios
Objetivo del juego: Velocidad y habilidad mental son las armas más importantes en esta versión de un antiguo juego asiático. Despeja el tablero lo antes posible haciendo clic en las fichas iguales y gánate la fama eterna de la puntuación más alta.
Chainz 2Chainz 2
Jugadores: 6955
Categoría del juego: Puzzles
Objetivo del juego: Entra en el mundo de las combinaciones con Chainz 2: Relinked, emocionante secuela del exitazo del año pasado, Chainz. Gira eslabones y crea combinaciones de 3 ó más.
DeliciousDelicious
Jugadores: 4405
Categoría del juego: Acción
Objetivo del juego: ¿Eres un as de la multitarea? ¿Quieres que tus clientes estén contentos? ¡Pues Delicious es tu juego! Sacia el apetito de los clientes y tenlos contentos; ¡no te arriesgues!
BookwormBookworm
Jugadores: 4568
Categoría del juego: Palabras
Objetivo del juego: Junta las letras para formar palabras. ¡Las palabras más largas valen más puntos!
ZumaZuma
Jugadores: 4976
Categoría del juego: Acción
Objetivo del juego: Controla el ídolo de la rana de piedra de los antiguos Zuma en este intrigante enigma de acción. ¡Dispara bolas para formar conjuntos de tres, pero si dejas que lleguen a la calavera dorada morirás!
Jewel of AtlantisJewel of Atlantis
Jugadores: 3798
Categoría del juego: Puzzles
Objetivo del juego: Descubre la ciudad hundida de la Atlántida y busca valiosos tesoros. Viaja más allá de las profundidades del mar y vive trepidantes aventuras en Jewel of Atlantis.
Jewel QuestJewel Quest
Jugadores: 3727
Categoría del juego: Puzzles
Objetivo del juego: Convierte la arena de la antigua selva en oro tan rápido como puedas juntando grupos de 3 elementos. ¡Los grupos más grandes valen más puntos!
Bejeweled 2Bejeweled 2
Jugadores: 3659
Categoría del juego: Puzzles
Objetivo del juego: Con cuatro modos de juego únicos y fascinantes, nuevas piezas de juego explosivas e imponentes fondos planetarios, Bejeweled 2 es mucho más adictivo que nunca.
Contenidos gratis en tu webSiguiente >>

Fotos divertidas
fotos_increibles_0227.jpg
Contenidos Web
microrobots avion deportes riesgo recetas cocina canaria juegos online gratis moto motociclismo horoscopos naranjas valencianas surf canarias montañismo ciudades turismo postales gratis library Horoscopos Diarios Windsurf Canarias
fregadero microondas placa electrica bañopreparar camper pantalla plananevera compresor electricacamper fiat ducato camper baño quimicomampara enrollable bañocamper aire climatizadofurgoneta surf windsurffurgoneta surf windsurftelevisor furgonetas camperfurgonetas camper cama

Sudoku del día
Nivel de dificultad: Fácil



Cómo jugar:
El juego consiste en colocar los números del 1 al nueve de tal forma que no se repita el mismo número en la columna, fila y caja (bloques 3x3 enmarcados).

©Contenidos Gratis | Sudoku en tu mail

Warning: array_rand(): First argument has to be an array in /var/www/html/contenidos/efemerides.php on line 14
Sucedió el...

31 de agosto de

Efemérides en tu mail
©Contenidos Gratis
windsurf canarias youtube porno canarias baleares valencia madrid