1 | <HTML
|
---|
2 | ><HEAD
|
---|
3 | ><TITLE
|
---|
4 | >ifx_getsqlca</TITLE
|
---|
5 | ><META
|
---|
6 | NAME="GENERATOR"
|
---|
7 | CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
---|
8 | REL="HOME"
|
---|
9 | TITLE="Manuál PHP"
|
---|
10 | HREF="index.html"><LINK
|
---|
11 | REL="UP"
|
---|
12 | TITLE="Informix functions"
|
---|
13 | HREF="ref.ifx.html"><LINK
|
---|
14 | REL="PREVIOUS"
|
---|
15 | TITLE="ifx_get_char"
|
---|
16 | HREF="function.ifx-get-char.html"><LINK
|
---|
17 | REL="NEXT"
|
---|
18 | TITLE="ifx_htmltbl_result"
|
---|
19 | HREF="function.ifx-htmltbl-result.html"><META
|
---|
20 | HTTP-EQUIV="Content-type"
|
---|
21 | CONTENT="text/html; charset=ISO-8859-2"></HEAD
|
---|
22 | ><BODY
|
---|
23 | CLASS="refentry"
|
---|
24 | BGCOLOR="#FFFFFF"
|
---|
25 | TEXT="#000000"
|
---|
26 | LINK="#0000FF"
|
---|
27 | VLINK="#840084"
|
---|
28 | ALINK="#0000FF"
|
---|
29 | ><DIV
|
---|
30 | CLASS="NAVHEADER"
|
---|
31 | ><TABLE
|
---|
32 | SUMMARY="Header navigation table"
|
---|
33 | WIDTH="100%"
|
---|
34 | BORDER="0"
|
---|
35 | CELLPADDING="0"
|
---|
36 | CELLSPACING="0"
|
---|
37 | ><TR
|
---|
38 | ><TH
|
---|
39 | COLSPAN="3"
|
---|
40 | ALIGN="center"
|
---|
41 | >Manuál PHP</TH
|
---|
42 | ></TR
|
---|
43 | ><TR
|
---|
44 | ><TD
|
---|
45 | WIDTH="10%"
|
---|
46 | ALIGN="left"
|
---|
47 | VALIGN="bottom"
|
---|
48 | ><A
|
---|
49 | HREF="function.ifx-get-char.html"
|
---|
50 | ACCESSKEY="P"
|
---|
51 | >Pøedcházející</A
|
---|
52 | ></TD
|
---|
53 | ><TD
|
---|
54 | WIDTH="80%"
|
---|
55 | ALIGN="center"
|
---|
56 | VALIGN="bottom"
|
---|
57 | ></TD
|
---|
58 | ><TD
|
---|
59 | WIDTH="10%"
|
---|
60 | ALIGN="right"
|
---|
61 | VALIGN="bottom"
|
---|
62 | ><A
|
---|
63 | HREF="function.ifx-htmltbl-result.html"
|
---|
64 | ACCESSKEY="N"
|
---|
65 | >Dal¹í</A
|
---|
66 | ></TD
|
---|
67 | ></TR
|
---|
68 | ></TABLE
|
---|
69 | ><HR
|
---|
70 | ALIGN="LEFT"
|
---|
71 | WIDTH="100%"></DIV
|
---|
72 | ><H1
|
---|
73 | ><A
|
---|
74 | NAME="function.ifx-getsqlca"
|
---|
75 | ></A
|
---|
76 | >ifx_getsqlca</H1
|
---|
77 | ><DIV
|
---|
78 | CLASS="refnamediv"
|
---|
79 | ><A
|
---|
80 | NAME="AEN36074"
|
---|
81 | ></A
|
---|
82 | ><P
|
---|
83 | > (PHP 3>= 3.0.8, PHP 4 )</P
|
---|
84 | >ifx_getsqlca --
|
---|
85 | Get the contents of sqlca.sqlerrd[0..5] after a query
|
---|
86 | </DIV
|
---|
87 | ><DIV
|
---|
88 | CLASS="refsect1"
|
---|
89 | ><A
|
---|
90 | NAME="AEN36077"
|
---|
91 | ></A
|
---|
92 | ><H2
|
---|
93 | >Description</H2
|
---|
94 | >array <B
|
---|
95 | CLASS="methodname"
|
---|
96 | >ifx_getsqlca</B
|
---|
97 | > ( int result_id)<BR
|
---|
98 | ></BR
|
---|
99 | ><P
|
---|
100 | > <TT
|
---|
101 | CLASS="parameter"
|
---|
102 | ><I
|
---|
103 | >result_id</I
|
---|
104 | ></TT
|
---|
105 | > is a valid result id returned by
|
---|
106 | <A
|
---|
107 | HREF="function.ifx-query.html"
|
---|
108 | ><B
|
---|
109 | CLASS="function"
|
---|
110 | >ifx_query()</B
|
---|
111 | ></A
|
---|
112 | > or
|
---|
113 | <A
|
---|
114 | HREF="function.ifx-prepare.html"
|
---|
115 | ><B
|
---|
116 | CLASS="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
|
---|
126 | CLASS="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
|
---|
145 | WIDTH="100%"
|
---|
146 | BORDER="0"
|
---|
147 | CELLPADDING="0"
|
---|
148 | CELLSPACING="0"
|
---|
149 | CLASS="EXAMPLE"
|
---|
150 | ><TR
|
---|
151 | ><TD
|
---|
152 | ><DIV
|
---|
153 | CLASS="example"
|
---|
154 | ><A
|
---|
155 | NAME="AEN36092"
|
---|
156 | ></A
|
---|
157 | ><P
|
---|
158 | ><B
|
---|
159 | >Pøíklad 1. Retrieve Informix sqlca.sqlerrd[x] values</B
|
---|
160 | ></P
|
---|
161 | ><TABLE
|
---|
162 | BORDER="0"
|
---|
163 | BGCOLOR="#E0E0E0"
|
---|
164 | CELLPADDING="5"
|
---|
165 | ><TR
|
---|
166 | ><TD
|
---|
167 | ><PRE
|
---|
168 | CLASS="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);
|
---|
172 | if (! $qid) {
|
---|
173 | ... error ...
|
---|
174 | }
|
---|
175 | $sqlca = ifx_getsqlca ($qid);
|
---|
176 | $serial_value = $sqlca["sqlerrd1"];
|
---|
177 | echo "The serial value of the inserted row is : " . $serial_value<br>\n";</PRE
|
---|
178 | ></TD
|
---|
179 | ></TR
|
---|
180 | ></TABLE
|
---|
181 | ></DIV
|
---|
182 | ></TD
|
---|
183 | ></TR
|
---|
184 | ></TABLE
|
---|
185 | ></DIV
|
---|
186 | ><DIV
|
---|
187 | CLASS="NAVFOOTER"
|
---|
188 | ><HR
|
---|
189 | ALIGN="LEFT"
|
---|
190 | WIDTH="100%"><TABLE
|
---|
191 | SUMMARY="Footer navigation table"
|
---|
192 | WIDTH="100%"
|
---|
193 | BORDER="0"
|
---|
194 | CELLPADDING="0"
|
---|
195 | CELLSPACING="0"
|
---|
196 | ><TR
|
---|
197 | ><TD
|
---|
198 | WIDTH="33%"
|
---|
199 | ALIGN="left"
|
---|
200 | VALIGN="top"
|
---|
201 | ><A
|
---|
202 | HREF="function.ifx-get-char.html"
|
---|
203 | ACCESSKEY="P"
|
---|
204 | >Pøedcházející</A
|
---|
205 | ></TD
|
---|
206 | ><TD
|
---|
207 | WIDTH="34%"
|
---|
208 | ALIGN="center"
|
---|
209 | VALIGN="top"
|
---|
210 | ><A
|
---|
211 | HREF="index.html"
|
---|
212 | ACCESSKEY="H"
|
---|
213 | >Domù</A
|
---|
214 | ></TD
|
---|
215 | ><TD
|
---|
216 | WIDTH="33%"
|
---|
217 | ALIGN="right"
|
---|
218 | VALIGN="top"
|
---|
219 | ><A
|
---|
220 | HREF="function.ifx-htmltbl-result.html"
|
---|
221 | ACCESSKEY="N"
|
---|
222 | >Dal¹í</A
|
---|
223 | ></TD
|
---|
224 | ></TR
|
---|
225 | ><TR
|
---|
226 | ><TD
|
---|
227 | WIDTH="33%"
|
---|
228 | ALIGN="left"
|
---|
229 | VALIGN="top"
|
---|
230 | >ifx_get_char</TD
|
---|
231 | ><TD
|
---|
232 | WIDTH="34%"
|
---|
233 | ALIGN="center"
|
---|
234 | VALIGN="top"
|
---|
235 | ><A
|
---|
236 | HREF="ref.ifx.html"
|
---|
237 | ACCESSKEY="U"
|
---|
238 | >Nahoru</A
|
---|
239 | ></TD
|
---|
240 | ><TD
|
---|
241 | WIDTH="33%"
|
---|
242 | ALIGN="right"
|
---|
243 | VALIGN="top"
|
---|
244 | >ifx_htmltbl_result</TD
|
---|
245 | ></TR
|
---|
246 | ></TABLE
|
---|
247 | ></DIV
|
---|
248 | ></BODY
|
---|
249 | ></HTML
|
---|
250 | >
|
---|