From b345ae6252d0448bacbeba5e095f7e3aebaa188e Mon Sep 17 00:00:00 2001 From: Danny Heijl Date: Thu, 13 Jan 2000 21:35:59 +0000 Subject: [PATCH] Some corrections. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@18587 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/ifx.xml | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/functions/ifx.xml b/functions/ifx.xml index 8c407ac32a..ca952e240c 100644 --- a/functions/ifx.xml +++ b/functions/ifx.xml @@ -4,9 +4,9 @@ - The Informix driver for Online (ODS) 7.x, SE 7.x and Universal + The Informix driver for Informix (IDS) 7.x, SE 7.x and Universal Server (IUS) 9.x is implemented in "functions/ifx.ec" and - "functions/php3_ifx.h". ODS 7.x support is fairly complete, + "functions/php3_ifx.h". IDS 7.x support is fairly complete, with full support for BYTE and TEXT columns. IUS 9.x support is partly finished: the new data types are there, but SLOB and CLOB support is still under construction. @@ -15,7 +15,8 @@ Configuration notes Before you run the "configure" script, make sure that the - "INFORMIXDIR" variable has been set. + "INFORMIXDIR" variable has been set, and that $INFORMIXDIR/bin + is in your PATH. The configure script will autodetect the libraries and include directories, if you run "configure --with_informix=yes". You can @@ -59,11 +60,11 @@ 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, without the use of blob id's - for select queries. + 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, without the use of blob id's for + columns, so that you don't need to use blob id's for select queries. @@ -102,7 +103,7 @@ This can be set with the configuration variable ifx.charasvarchar : if set to 1 trailing spaces will be automatically - trimmed. + trimmed, to save you some "chopping". @@ -159,7 +160,7 @@ Connect to a Informix database -$conn_id = ifx_pconnect (mydb@ol_srv1, "imyself", "mypassword"); +$conn_id = ifx_pconnect ("mydb@ol_srv1", "imyself", "mypassword"); @@ -239,7 +240,7 @@ $conn_id = ifx_pconnect (mydb@ol_srv1, "imyself", "mypassword"); Closing a Informix connection -$conn_id = ifx_connect (mydb@ol_srv, "itsme", "mypassword"); +$conn_id = ifx_connect ("mydb@ol_srv", "itsme", "mypassword"); ... some queries and stuff ... ifx_close($conn_id); @@ -268,7 +269,7 @@ ifx_close($conn_id); Returns: A positive Informix result identifier on success, or false on error. - An integer "result_id" used by other functions to retrieve the + A "result_id" resource used by other functions to retrieve the query results. Sets "affected_rows" for retrieval by the ifx_affected_rows function. @@ -283,8 +284,11 @@ ifx_close($conn_id); conn_id. For "select-type" queries a cursor is declared and opened. The optional cursor_type parameter allows you to make this a "scroll" and/or "hold" - cursor. It's a mask and can be either IFX_SCROLL, IFX_HOLD, or both + cursor. It's a bitmask and can be either IFX_SCROLL, IFX_HOLD, or both or'ed together. Non-select queries are "execute immediate". + IFX_SCROLL and IFX_HOLD are symbolic constants and as such shouldn't + be between quotes. I you omit this parameter the cursor is a normal + sequential cursor. For either query type the number of (estimated or real) affected rows is saved for retrieval by ifx_affected_rows. @@ -368,7 +372,7 @@ ifx_free_result($res_id); conn_id. For "select-type" queries a cursor is declared and opened. The optional cursor_type parameter allows you to make this a "scroll" and/or "hold" - cursor. It's a mask and can be either IFX_SCROLL, IFX_HOLD, or both + cursor. It's a bitmask and can be either IFX_SCROLL, IFX_HOLD, or both or'ed together. For either query type the estimated number of affected rows is @@ -512,7 +516,10 @@ printf("%s\n<br>", ifx_errormsg(-201)); For inserts, updates and deletes the number is the real number (sqlerrd[2]) of affected rows. For selects it is an estimate - (sqlerrd[0]). Don't rely on it. + (sqlerrd[0]). Don't rely on it. The database server can never + return the actual number of rows that will be returned by a SELECT + because it has not even begun fetching them at this stage (just after + the "PREPARE" when the optimizer has determined the query plan). Useful after ifx_prepare to limit queries to reasonable result sets. @@ -552,13 +559,13 @@ if ($rowcount > 1000) { ifx_query or ifx_prepare. - Returns a pseudo-row (assiociative arry) with sqlca.sqlerrd[0] to sqlca.sqlerrd[5] + Returns a pseudo-row (assiociative array) with sqlca.sqlerrd[0] ... sqlca.sqlerrd[5] after the query associated with result_id. For inserts, updates and deletes the values returned are those as set by the server after executing the query. This gives access to the number of affected - rows and the serial insert value. For selects the values are those saved after - the prepare statement. This gives access to the estimated number of + rows and the serial insert value. For SELECTs the values are those saved after + the PREPARE statement. This gives access to the *estimated* number of affected rows. The use of this function saves the overhead of executing a "select dbinfo('sqlca.sqlerrdx')" query, as it retrieves the values that were saved by the ifx driver at the appropriate moment. @@ -609,14 +616,14 @@ echo "The serial value of the inserted row is : " . $serial_value<br>\n"; optional parameter for a "fetch" operation on "scroll" cursors: "NEXT", "PREVIOUS", "CURRENT", "FIRST", "LAST" or a number. If you specify a number, an "absolute" row fetch is executed. This - parameter is optional, and only valid for scrollcursors. + parameter is optional, and only valid for SCROLL cursors. ifx_fetch_row fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an - array offset, starting at offset 0. + array offset, starting at offset 0, with the column name as key. - Subsequent call to ifx_fetch_row would + Subsequent calls to ifx_fetch_row would return the next row in the result set, or false if there are no more rows.