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

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

Prvotní import všeho

File size: 4.9 KB
Line 
1<HTML
2><HEAD
3><TITLE
4>ifx_fetch_row</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_errormsg"
16HREF="function.ifx-errormsg.html"><LINK
17REL="NEXT"
18TITLE="ifx_fieldproperties"
19HREF="function.ifx-fieldproperties.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-errormsg.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-fieldproperties.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-fetch-row"
75></A
76>ifx_fetch_row</H1
77><DIV
78CLASS="refnamediv"
79><A
80NAME="AEN35928"
81></A
82><P
83> (PHP 3&#62;= 3.0.3, PHP 4 )</P
84>ifx_fetch_row&nbsp;--&nbsp;Get row as enumerated array</DIV
85><DIV
86CLASS="refsect1"
87><A
88NAME="AEN35931"
89></A
90><H2
91>Description</H2
92>array <B
93CLASS="methodname"
94>ifx_fetch_row</B
95> ( int result_id [, mixed position])<BR
96></BR
97><P
98>
99 Returns an associative array that corresponds to the fetched row,
100 or <TT
101CLASS="constant"
102><B
103>FALSE</B
104></TT
105> if there are no more rows.
106 </P
107><P
108>&#13; Blob columns are returned as integer blob id values for use in
109 <A
110HREF="function.ifx-get-blob.html"
111><B
112CLASS="function"
113>ifx_get_blob()</B
114></A
115> unless you have used
116 ifx_textasvarchar(1) or ifx_byteasvarchar(1), in which case blobs
117 are returned as string values. Returns <TT
118CLASS="constant"
119><B
120>FALSE</B
121></TT
122> on error
123 </P
124><P
125>&#13; <TT
126CLASS="parameter"
127><I
128>result_id</I
129></TT
130> is a valid resultid returned by
131 <A
132HREF="function.ifx-query.html"
133><B
134CLASS="function"
135>ifx_query()</B
136></A
137> or
138 <A
139HREF="function.ifx-prepare.html"
140><B
141CLASS="function"
142>ifx_prepare()</B
143></A
144> (select type queries only!).
145 </P
146><P
147>&#13; <TT
148CLASS="parameter"
149><I
150>position</I
151></TT
152> is an
153 optional parameter for a "fetch" operation on "scroll" cursors:
154 "NEXT", "PREVIOUS", "CURRENT", "FIRST", "LAST" or a number. If
155 you specify a number, an "absolute" row fetch is executed. This
156 parameter is optional, and only valid for SCROLL cursors.
157 </P
158><P
159>&#13; <B
160CLASS="function"
161>ifx_fetch_row()</B
162> fetches one row of data from
163 the result associated with the specified result identifier. The
164 row is returned as an array. Each result column is stored in an
165 array offset, starting at offset 0, with the column name as key.
166 </P
167><P
168>&#13; Subsequent calls to <B
169CLASS="function"
170>ifx_fetch_row()</B
171> would
172 return the next row in the result set, or <TT
173CLASS="constant"
174><B
175>FALSE</B
176></TT
177> if there are no
178 more rows.
179 </P
180><TABLE
181WIDTH="100%"
182BORDER="0"
183CELLPADDING="0"
184CELLSPACING="0"
185CLASS="EXAMPLE"
186><TR
187><TD
188><DIV
189CLASS="example"
190><A
191NAME="AEN35958"
192></A
193><P
194><B
195>Pøíklad 1. Informix fetch rows</B
196></P
197><TABLE
198BORDER="0"
199BGCOLOR="#E0E0E0"
200CELLPADDING="5"
201><TR
202><TD
203><PRE
204CLASS="php"
205>$rid = ifx_prepare ("select * from emp where name like " . $name,
206 $connid, IFX_SCROLL);
207if (! $rid) {
208 ... error ...
209}
210$rowcount = ifx_affected_rows($rid);
211if ($rowcount &#62; 1000) {
212 printf ("Too many rows in result set (%d)\n&#60;br&#62;", $rowcount);
213 die ("Please restrict your query&#60;br&#62;\n");
214}
215if (! ifx_do ($rid)) {
216 ... error ...
217}
218$row = ifx_fetch_row ($rid, "NEXT");
219while (is_array($row)) {
220 for(reset($row); $fieldname=key($row); next($row)) {
221 $fieldvalue = $row[$fieldname];
222 printf ("%s = %s,", $fieldname, $fieldvalue);
223 }
224 printf("\n&#60;br&#62;");
225 $row = ifx_fetch_row ($rid, "NEXT");
226}
227ifx_free_result ($rid);</PRE
228></TD
229></TR
230></TABLE
231></DIV
232></TD
233></TR
234></TABLE
235></DIV
236><DIV
237CLASS="NAVFOOTER"
238><HR
239ALIGN="LEFT"
240WIDTH="100%"><TABLE
241SUMMARY="Footer navigation table"
242WIDTH="100%"
243BORDER="0"
244CELLPADDING="0"
245CELLSPACING="0"
246><TR
247><TD
248WIDTH="33%"
249ALIGN="left"
250VALIGN="top"
251><A
252HREF="function.ifx-errormsg.html"
253ACCESSKEY="P"
254>Pøedcházející</A
255></TD
256><TD
257WIDTH="34%"
258ALIGN="center"
259VALIGN="top"
260><A
261HREF="index.html"
262ACCESSKEY="H"
263>Domù</A
264></TD
265><TD
266WIDTH="33%"
267ALIGN="right"
268VALIGN="top"
269><A
270HREF="function.ifx-fieldproperties.html"
271ACCESSKEY="N"
272>Dal¹í</A
273></TD
274></TR
275><TR
276><TD
277WIDTH="33%"
278ALIGN="left"
279VALIGN="top"
280>ifx_errormsg</TD
281><TD
282WIDTH="34%"
283ALIGN="center"
284VALIGN="top"
285><A
286HREF="ref.ifx.html"
287ACCESSKEY="U"
288>Nahoru</A
289></TD
290><TD
291WIDTH="33%"
292ALIGN="right"
293VALIGN="top"
294>ifx_fieldproperties</TD
295></TR
296></TABLE
297></DIV
298></BODY
299></HTML
300>
Note: See TracBrowser for help on using the repository browser.