Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > ebb1914cf182a88528b4547490db1dd8 > files > 842

kdewebdev-quanta-doc-3.5.9-2mdv2008.1.x86_64.rpm

<HTML
><HEAD
><TITLE
>ifx_getsqlca</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="manual.html"><LINK
REL="UP"
TITLE="Informix functions"
HREF="ref.ifx.html"><LINK
REL="PREVIOUS"
TITLE="ifx_affected_rows"
HREF="function.ifx-affected-rows.html"><LINK
REL="NEXT"
TITLE="ifx_fetch_row"
HREF="function.ifx-fetch-row.html"></HEAD
><BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.ifx-affected-rows.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.ifx-fetch-row.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.ifx-getsqlca"
>ifx_getsqlca</A
></H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN14121"
></A
>ifx_getsqlca -- 
     Get the contents of sqlca.sqlerrd[0..5] after a query
    </DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN14124"
></A
><H2
>Description</H2
><DIV
CLASS="funcsynopsis"
><P
></P
><CODE
CLASS="FUNCDEF"
>array ifx_getsqlca</CODE
>(int result_id);<P
></P
></DIV
><P
>&#13;     <TT
CLASS="parameter"
><I
>result_id</I
></TT
> is a valid result id returned by
     <A
HREF="function.ifx-query.html"
><B
CLASS="function"
>ifx_query()</B
></A
> or
     <A
HREF="function.ifx-prepare.html"
><B
CLASS="function"
>ifx_prepare()</B
></A
>. 
    </P
><P
> 
     Returns a pseudo-row (assiociative array) with sqlca.sqlerrd[0]
     ... sqlca.sqlerrd[5] after the query associated with
     <TT
CLASS="parameter"
><I
>result_id</I
></TT
>.
    </P
><P
> 
     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
     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.
    </P
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><P
><B
>Example 1. Retrieve Informix sqlca.sqlerrd[x] values</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>  1&nbsp;
  2&nbsp;/* assume the first column of 'sometable' is a serial */
  3&nbsp;$qid = ifx_query("insert into sometable 
  4&nbsp;                  values (0, '2nd column', 'another column' ", $connid);
  5&nbsp;if (! $qid) {
  6&nbsp;    ... error ...
  7&nbsp;}
  8&nbsp;$sqlca = ifx_getsqlca ($qid);
  9&nbsp;$serial_value = $sqlca["sqlerrd1"];
 10&nbsp;echo "The serial value of the inserted row is : " . $serial_value&#60;br&#62;\n"; 
 11&nbsp;     </PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.ifx-affected-rows.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="manual.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.ifx-fetch-row.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>ifx_affected_rows</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.ifx.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>ifx_fetch_row</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>