source: www/manuals/PHP_manual/function.ifx-getsqlca.html@ 1

Last change on this file since 1 was 1, checked in by george, 17 years ago

Prvotní import všeho

File size: 3.9 KB
Line 
1<HTML
2><HEAD
3><TITLE
4>ifx_getsqlca</TITLE
5><META
6NAME="GENERATOR"
7CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
8REL="HOME"
9TITLE="Manuál PHP"
10HREF="index.html"><LINK
11REL="UP"
12TITLE="Informix functions"
13HREF="ref.ifx.html"><LINK
14REL="PREVIOUS"
15TITLE="ifx_get_char"
16HREF="function.ifx-get-char.html"><LINK
17REL="NEXT"
18TITLE="ifx_htmltbl_result"
19HREF="function.ifx-htmltbl-result.html"><META
20HTTP-EQUIV="Content-type"
21CONTENT="text/html; charset=ISO-8859-2"></HEAD
22><BODY
23CLASS="refentry"
24BGCOLOR="#FFFFFF"
25TEXT="#000000"
26LINK="#0000FF"
27VLINK="#840084"
28ALINK="#0000FF"
29><DIV
30CLASS="NAVHEADER"
31><TABLE
32SUMMARY="Header navigation table"
33WIDTH="100%"
34BORDER="0"
35CELLPADDING="0"
36CELLSPACING="0"
37><TR
38><TH
39COLSPAN="3"
40ALIGN="center"
41>Manuál PHP</TH
42></TR
43><TR
44><TD
45WIDTH="10%"
46ALIGN="left"
47VALIGN="bottom"
48><A
49HREF="function.ifx-get-char.html"
50ACCESSKEY="P"
51>Pøedcházející</A
52></TD
53><TD
54WIDTH="80%"
55ALIGN="center"
56VALIGN="bottom"
57></TD
58><TD
59WIDTH="10%"
60ALIGN="right"
61VALIGN="bottom"
62><A
63HREF="function.ifx-htmltbl-result.html"
64ACCESSKEY="N"
65>Dal¹í</A
66></TD
67></TR
68></TABLE
69><HR
70ALIGN="LEFT"
71WIDTH="100%"></DIV
72><H1
73><A
74NAME="function.ifx-getsqlca"
75></A
76>ifx_getsqlca</H1
77><DIV
78CLASS="refnamediv"
79><A
80NAME="AEN36074"
81></A
82><P
83> (PHP 3&#62;= 3.0.8, PHP 4 )</P
84>ifx_getsqlca&nbsp;--&nbsp;
85 Get the contents of sqlca.sqlerrd[0..5] after a query
86 </DIV
87><DIV
88CLASS="refsect1"
89><A
90NAME="AEN36077"
91></A
92><H2
93>Description</H2
94>array <B
95CLASS="methodname"
96>ifx_getsqlca</B
97> ( int result_id)<BR
98></BR
99><P
100>&#13; <TT
101CLASS="parameter"
102><I
103>result_id</I
104></TT
105> is a valid result id returned by
106 <A
107HREF="function.ifx-query.html"
108><B
109CLASS="function"
110>ifx_query()</B
111></A
112> or
113 <A
114HREF="function.ifx-prepare.html"
115><B
116CLASS="function"
117>ifx_prepare()</B
118></A
119>.
120 </P
121><P
122>
123 Returns a pseudo-row (associative array) with sqlca.sqlerrd[0]
124 ... sqlca.sqlerrd[5] after the query associated with
125 <TT
126CLASS="parameter"
127><I
128>result_id</I
129></TT
130>.
131 </P
132><P
133>
134 For inserts, updates and deletes the values returned are those as
135 set by the server after executing the query. This gives access to
136 the number of affected rows and the serial insert value. For
137 SELECTs the values are those saved after the PREPARE
138 statement. This gives access to the *estimated* number of
139 affected rows. The use of this function saves the overhead of
140 executing a "select dbinfo('sqlca.sqlerrdx')" query, as it
141 retrieves the values that were saved by the ifx driver at the
142 appropriate moment.
143 </P
144><TABLE
145WIDTH="100%"
146BORDER="0"
147CELLPADDING="0"
148CELLSPACING="0"
149CLASS="EXAMPLE"
150><TR
151><TD
152><DIV
153CLASS="example"
154><A
155NAME="AEN36092"
156></A
157><P
158><B
159>Pøíklad 1. Retrieve Informix sqlca.sqlerrd[x] values</B
160></P
161><TABLE
162BORDER="0"
163BGCOLOR="#E0E0E0"
164CELLPADDING="5"
165><TR
166><TD
167><PRE
168CLASS="php"
169>/* assume the first column of 'sometable' is a serial */
170$qid = ifx_query("insert into sometable
171 values (0, '2nd column', 'another column') ", $connid);
172if (! $qid) {
173 ... error ...
174}
175$sqlca = ifx_getsqlca ($qid);
176$serial_value = $sqlca["sqlerrd1"];
177echo "The serial value of the inserted row is : " . $serial_value&#60;br&#62;\n";</PRE
178></TD
179></TR
180></TABLE
181></DIV
182></TD
183></TR
184></TABLE
185></DIV
186><DIV
187CLASS="NAVFOOTER"
188><HR
189ALIGN="LEFT"
190WIDTH="100%"><TABLE
191SUMMARY="Footer navigation table"
192WIDTH="100%"
193BORDER="0"
194CELLPADDING="0"
195CELLSPACING="0"
196><TR
197><TD
198WIDTH="33%"
199ALIGN="left"
200VALIGN="top"
201><A
202HREF="function.ifx-get-char.html"
203ACCESSKEY="P"
204>Pøedcházející</A
205></TD
206><TD
207WIDTH="34%"
208ALIGN="center"
209VALIGN="top"
210><A
211HREF="index.html"
212ACCESSKEY="H"
213>Domù</A
214></TD
215><TD
216WIDTH="33%"
217ALIGN="right"
218VALIGN="top"
219><A
220HREF="function.ifx-htmltbl-result.html"
221ACCESSKEY="N"
222>Dal¹í</A
223></TD
224></TR
225><TR
226><TD
227WIDTH="33%"
228ALIGN="left"
229VALIGN="top"
230>ifx_get_char</TD
231><TD
232WIDTH="34%"
233ALIGN="center"
234VALIGN="top"
235><A
236HREF="ref.ifx.html"
237ACCESSKEY="U"
238>Nahoru</A
239></TD
240><TD
241WIDTH="33%"
242ALIGN="right"
243VALIGN="top"
244>ifx_htmltbl_result</TD
245></TR
246></TABLE
247></DIV
248></BODY
249></HTML
250>
Note: See TracBrowser for help on using the repository browser.