CVS update: php3/doc/functions

From: Date: Fri, 18 Sep 1998 05:38:26 +0000
Subject: CVS update: php3/doc/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-1214@lists.php.net to get a copy of this message
Date: Friday September 18, 1998 @ 1:38 Author: eschmid Update of /repository/php3/doc/functions In directory asf:/u2/tmp/cvs-serv8505 Modified Files: ifx.sgml Log Message: The rest will follow later. Have to do some other work. Index: php3/doc/functions/ifx.sgml diff -c php3/doc/functions/ifx.sgml:1.4 php3/doc/functions/ifx.sgml:1.5 *** php3/doc/functions/ifx.sgml:1.4 Thu Sep 17 17:02:12 1998 --- php3/doc/functions/ifx.sgml Fri Sep 18 01:38:23 1998 *************** *** 368,487 **** didn't return any data). </para><para> See also: <function>ifx_errormsg</function> </refsect1> </refentry> ! ! <!-- ! <refentry id="function.ifx-result"> <refnamediv> ! <refname>ifx_result</refname> ! <refpurpose>get result data</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> ! <funcdef>int <function>ifx_result</function></funcdef> ! <paramdef>int <parameter>result</parameter></paramdef> ! <paramdef>int <parameter>row</parameter></paramdef> ! <paramdef>mixed <parameter>field</parameter></paramdef> </funcsynopsis> - <para> - Returns: The contents of the cell at the row and offset in the - specified Informix result set. - <para> - <function>ifx_result</function> returns the contents of one - cell from a Informix result set. The field argument can be the - field's offset, or the field's name, or the field's table dot - field's name (fieldname.tablename). If the column name has been - aliased ('select foo as bar from...'), use the alias instead of - the column name. <para> ! When working on large result sets, you should consider using one ! of the functions that fetch an entire row (specified below). As ! these functions return the contents of multiple cells in one ! function call, they're MUCH quicker than ! <function>ifx_result</function>. Also, note that specifying a ! numeric offset for the field argument is much quicker than ! specifying a fieldname or tablename.fieldname argument. ! <para> ! Recommended high-performance alternatives: ! <function>ifx_fetch_row</function>, ! <function>ifx_fetch_array</function>, and ! <function>ifx_fetch_object</function>. </refsect1> </refentry> - --> ! <refentry id="function.ifx-errormsg"> <refnamediv> ! <refname>ifx_errormsg</refname> ! <refpurpose>returns error message of last Informix call</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> ! <funcdef>string <function>ifx_errormsg</function></funcdef> ! <paramdef>int <parameter><optional>errorcode</optional></parameter></paramdef> </funcsynopsis> <para> ! Returns the Informix error message associated with ! the most recent Informix error, or, ! when the optional "<parameter>errorcode</parameter>" param is present, ! the error message corresponding to "<parameter>errorcode</parameter>". ! <para> ! See also: <function>ifx_error</function> </refsect1> </refentry> - <refentry id="function.ifx-fetch-row"> <refnamediv> <refname>ifx_fetch_row</refname> ! <refpurpose>get row as enumerated array</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcdef>array <function>ifx_fetch_row</function></funcdef> ! <paramdef>int <parameter>result</parameter></paramdef> </funcsynopsis> <para> ! Returns: An array that corresponds to the fetched row, or false ! if there are no more rows. ! <para> <function>ifx_fetch_row</function> 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. ! <para> Subsequent call to <function>ifx_fetch_row</function> would return the next row in the result set, or false if there are no more rows. </refsect1> </refentry> ! <refentry id="function.ifx-affected-rows"> <refnamediv> ! <refname>ifx_affected_rows</refname> ! <refpurpose>get number of rows affected by a query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> ! <funcdef>int <function>ifx_affected_rows</function></funcdef> ! <paramdef>int <parameter>result_id</parameter></paramdef> </funcsynopsis> <para> ! Returns the number of rows affected by a query associated with ! <parameter>result_id</parameter>. <para> ! For inserts, updates and deletes the number is the real number ! of affected rows. For selects it is an estimate. Don't rely on it. <para> ! See also: <function>ifx_num_rows</function> </refsect1> </refentry> <refentry id="function.ifx-num-rows"> <refnamediv> --- 368,567 ---- didn't return any data). </para><para> See also: <function>ifx_errormsg</function> + </para> </refsect1> </refentry> ! <refentry id="function.ifx-errormsg"> <refnamediv> ! <refname>ifx_errormsg</refname> ! <refpurpose>Returns error message of last Informix call</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> ! <funcdef>string <function>ifx_errormsg</function></funcdef> ! <paramdef>int <parameter><optional>errorcode</optional></parameter></paramdef> </funcsynopsis> <para> ! Returns the Informix error message associated with the most ! recent Informix error, or, when the optional ! "<parameter>errorcode</parameter>" param is present, the error ! message corresponding to "<parameter>errorcode</parameter>". ! </para><para> ! See also: <function>ifx_error</function> ! </para> ! <informalexample> ! <programlisting> ! printf("%s\n&lt;br>", ifx_errormsg(-201)); ! </programlisting> ! </informalexample> </refsect1> </refentry> ! <refentry id="function.ifx-affected-rows"> <refnamediv> ! <refname>ifx_affected_rows</refname> ! <refpurpose>Get number of rows affected by a query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> ! <funcdef>int <function>ifx_affected_rows</function></funcdef> ! <paramdef>int <parameter>result_id</parameter></paramdef> </funcsynopsis> <para> ! <parameter>result_id</parameter> is a valid result id returned by ! <function>ifx_query</function> or ! <function>ifx_prepare</function>. ! </para><para> ! Returns the number of rows affected by a query associated with ! <parameter>result_id</parameter>. ! </para><para> ! 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. ! </para><para> ! Useful after <function>ifx_prepare</function> to limit queries to ! reasonable result sets. ! </para><para> ! See also: <function>ifx_num_rows</function> ! </para> ! <example> ! <title>Informix affected rows</title> ! <programlisting role="php3"> ! $rid = ifx_prepare ("select * from emp where name like " . $name, $connid); ! if (! $rid) { ! ... error ... ! } ! $rowcount = ifx_affected_rows ($rid); ! if ($rowcount > 1000) { ! printf ("Too many rows in result set (%d)\n&lt;br>", $rowcount); ! die ("Please restrict your query&lt;br>\n"); ! } ! </programlisting> ! </example> </refsect1> </refentry> <refentry id="function.ifx-fetch-row"> <refnamediv> <refname>ifx_fetch_row</refname> ! <refpurpose>Get row as enumerated array</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcdef>array <function>ifx_fetch_row</function></funcdef> ! <paramdef>int <parameter>result_id</parameter></paramdef> ! <paramdef>mixed <parameter><optional>position</optional> ! </parameter></paramdef> </funcsynopsis> <para> ! Returns an associative array that corresponds to the fetched row, ! or false if there are no more rows. ! </para><para> ! Blob columns are returned as integer blob id values for use in ! <function>ifx_get_blob</function> unless you have used ! ifx_textasvarchar(1) or ifx_byteasvarchar(1), in which case blobs ! are returned as string values. Returns FALSE on error ! </para><para> ! <parameter>result_id</parameter> is a valid resultid returned by ! <function>ifx_query</function> or ! <function>ifx_prepare</function> (select type queries only!). ! </para><para> ! <parameter><optional>position</optional></parameter> is an ! 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. ! </para><para> <function>ifx_fetch_row</function> 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. ! </para><para> Subsequent call to <function>ifx_fetch_row</function> would return the next row in the result set, or false if there are no more rows. + </para> + <example> + <title>Informix fetch rows</title> + <programlisting> + $rid = ifx_prepare ("select * from emp where name like " . $name, + $connid, "SCROLL"); + if (! $rid) { + ... error ... + } + $rowcount = ifx_affected_rows($rid); + if ($rowcount > 1000) { + printf ("Too many rows in result set (%d)\n&lt;br>", $rowcount); + die ("Please restrict your query&lt;br>\n"); + } + if (! ifx_do ($rid)) { + ... error ... + } + $row = ifx_fetch_row ($rid, "NEXT"); + while (is_array($row)) { + for(reset($row); $fieldname=key($row); next($row)) { + $fieldvalue = $row[$fieldname]; + printf ("%s = %s,", $fieldname, $fieldvalue); + } + printf("\n&lt;br>"); + $row = ifx_fetch_row ($rid, "NEXT"); + } + ifx_free_result ($rid); + + </programlisting> + </example> </refsect1> </refentry> ! ! <!-- ! <refentry id="function.ifx-result"> <refnamediv> ! <refname>ifx_result</refname> ! <refpurpose>get result data</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> ! <funcdef>int <function>ifx_result</function></funcdef> ! <paramdef>int <parameter>result</parameter></paramdef> ! <paramdef>int <parameter>row</parameter></paramdef> ! <paramdef>mixed <parameter>field</parameter></paramdef> </funcsynopsis> + <para> + Returns: The contents of the cell at the row and offset in the + specified Informix result set. <para> ! <function>ifx_result</function> returns the contents of one ! cell from a Informix result set. The field argument can be the ! field's offset, or the field's name, or the field's table dot ! field's name (fieldname.tablename). If the column name has been ! aliased ('select foo as bar from...'), use the alias instead of ! the column name. <para> ! When working on large result sets, you should consider using one ! of the functions that fetch an entire row (specified below). As ! these functions return the contents of multiple cells in one ! function call, they're MUCH quicker than ! <function>ifx_result</function>. Also, note that specifying a ! numeric offset for the field argument is much quicker than ! specifying a fieldname or tablename.fieldname argument. <para> ! Recommended high-performance alternatives: ! <function>ifx_fetch_row</function>, ! <function>ifx_fetch_array</function>, and ! <function>ifx_fetch_object</function>. </refsect1> </refentry> + --> + + + + <refentry id="function.ifx-num-rows"> <refnamediv> -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1214) next »