source: www/manuals/PHP_manual/function.ingres-fetch-array.html@ 1

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

Prvotní import všeho

File size: 5.5 KB
Line 
1<HTML
2><HEAD
3><TITLE
4>ingres_fetch_array</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="Ingres II functions"
13HREF="ref.ingres.html"><LINK
14REL="PREVIOUS"
15TITLE="ingres_connect"
16HREF="function.ingres-connect.html"><LINK
17REL="NEXT"
18TITLE="ingres_fetch_object"
19HREF="function.ingres-fetch-object.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.ingres-connect.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.ingres-fetch-object.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.ingres-fetch-array"
75></A
76>ingres_fetch_array</H1
77><DIV
78CLASS="refnamediv"
79><A
80NAME="AEN37330"
81></A
82><P
83> (PHP 4 &#62;= 4.0.2)</P
84>ingres_fetch_array&nbsp;--&nbsp;Fetch a row of result into an array</DIV
85><DIV
86CLASS="refsect1"
87><A
88NAME="AEN37333"
89></A
90><H2
91>Description</H2
92>array <B
93CLASS="methodname"
94>ingres_fetch_array</B
95> ( [int result_type [, resource link]])<BR
96></BR
97><DIV
98CLASS="warning"
99><P
100></P
101><TABLE
102CLASS="warning"
103BORDER="1"
104WIDTH="100%"
105><TR
106><TD
107ALIGN="CENTER"
108><B
109>Varování</B
110></TD
111></TR
112><TR
113><TD
114ALIGN="LEFT"
115><P
116>Tato funkce je
117<SPAN
118CLASS="emphasis"
119><I
120CLASS="emphasis"
121>EXPERIMENTÁLNÍ</I
122></SPAN
123>. Chování této funkce, její
124název a v¹echno ostatní, co je zde zdokumentováno, se v budoucích verzích
125PHP mù¾e BEZ OHLÁ©ENÍ zmìnit. Berte to v úvahu a pou¾ívejte tuto funkci na
126vlastní nebezpeèí.</P
127></TD
128></TR
129></TABLE
130></DIV
131><P
132>&#13; <B
133CLASS="function"
134>ingres_fetch_array()</B
135> Returns an array that
136 corresponds to the fetched row, or <TT
137CLASS="constant"
138><B
139>FALSE</B
140></TT
141> if there are no more
142 rows.
143 </P
144><P
145>&#13; This function is an extended version of
146 <A
147HREF="function.ingres-fetch-row.html"
148><B
149CLASS="function"
150>ingres_fetch_row()</B
151></A
152>. In addition to storing
153 the data in the numeric indices of the result array, it also
154 stores the data in associative indices, using the field names as
155 keys.
156 </P
157><P
158>&#13; If two or more columns of the result have the same field names,
159 the last column will take precedence. To access the other
160 column(s) of the same name, you must use the numeric index of the
161 column or make an alias for the column.
162 <DIV
163CLASS="informalexample"
164><A
165NAME="AEN37353"
166></A
167><P
168></P
169><TABLE
170BORDER="0"
171BGCOLOR="#E0E0E0"
172CELLPADDING="5"
173><TR
174><TD
175><PRE
176CLASS="programlisting"
177>ingres_query(select t1.f1 as foo t2.f1 as bar from t1, t2);
178$result = ingres_fetch_array();
179$foo = $result["foo"];
180$bar = $result["bar"];</PRE
181></TD
182></TR
183></TABLE
184><P
185></P
186></DIV
187>
188 </P
189><P
190>&#13; <TT
191CLASS="parameter"
192><I
193>result_type</I
194></TT
195> can be INGRES_NUM for
196 enumerated array, INGRES_ASSOC for associative array, or
197 INGRES_BOTH (default).
198 </P
199><P
200>&#13; Speed-wise, the function is identical to
201 <A
202HREF="function.ingres-fetch-object.html"
203><B
204CLASS="function"
205>ingres_fetch_object()</B
206></A
207>, and almost as quick as
208 <A
209HREF="function.ingres-fetch-row.html"
210><B
211CLASS="function"
212>ingres_fetch_row()</B
213></A
214> (the difference is
215 insignificant).
216 </P
217><P
218>&#13; <TABLE
219WIDTH="100%"
220BORDER="0"
221CELLPADDING="0"
222CELLSPACING="0"
223CLASS="EXAMPLE"
224><TR
225><TD
226><DIV
227CLASS="example"
228><A
229NAME="AEN37361"
230></A
231><P
232><B
233>Pøíklad 1. <B
234CLASS="function"
235>ingres_fetch_array()</B
236> example</B
237></P
238><TABLE
239BORDER="0"
240BGCOLOR="#E0E0E0"
241CELLPADDING="5"
242><TR
243><TD
244><PRE
245CLASS="php"
246>&#60;?php
247ingres_connect ($database, $user, $password);
248
249ingres_query ("select * from table");
250while ($row = ingres_fetch_array()) {
251 echo $row["user_id"]; # using associative array
252 echo $row["fullname"];
253 echo $row[1]; # using enumerated array
254 echo $row[2];
255}
256?&#62;</PRE
257></TD
258></TR
259></TABLE
260></DIV
261></TD
262></TR
263></TABLE
264>
265 </P
266><P
267>&#13; See also
268 <A
269HREF="function.ingres-query.html"
270><B
271CLASS="function"
272>ingres_query()</B
273></A
274>,
275 <A
276HREF="function.ingres-num-fields.html"
277><B
278CLASS="function"
279>ingres_num_fields()</B
280></A
281>,
282 <A
283HREF="function.ingres-field-name.html"
284><B
285CLASS="function"
286>ingres_field_name()</B
287></A
288>,
289 <A
290HREF="function.ingres-fetch-object.html"
291><B
292CLASS="function"
293>ingres_fetch_object()</B
294></A
295>, and
296 <A
297HREF="function.ingres-fetch-row.html"
298><B
299CLASS="function"
300>ingres_fetch_row()</B
301></A
302>.
303 </P
304></DIV
305><DIV
306CLASS="NAVFOOTER"
307><HR
308ALIGN="LEFT"
309WIDTH="100%"><TABLE
310SUMMARY="Footer navigation table"
311WIDTH="100%"
312BORDER="0"
313CELLPADDING="0"
314CELLSPACING="0"
315><TR
316><TD
317WIDTH="33%"
318ALIGN="left"
319VALIGN="top"
320><A
321HREF="function.ingres-connect.html"
322ACCESSKEY="P"
323>Pøedcházející</A
324></TD
325><TD
326WIDTH="34%"
327ALIGN="center"
328VALIGN="top"
329><A
330HREF="index.html"
331ACCESSKEY="H"
332>Domù</A
333></TD
334><TD
335WIDTH="33%"
336ALIGN="right"
337VALIGN="top"
338><A
339HREF="function.ingres-fetch-object.html"
340ACCESSKEY="N"
341>Dal¹í</A
342></TD
343></TR
344><TR
345><TD
346WIDTH="33%"
347ALIGN="left"
348VALIGN="top"
349>ingres_connect</TD
350><TD
351WIDTH="34%"
352ALIGN="center"
353VALIGN="top"
354><A
355HREF="ref.ingres.html"
356ACCESSKEY="U"
357>Nahoru</A
358></TD
359><TD
360WIDTH="33%"
361ALIGN="right"
362VALIGN="top"
363>ingres_fetch_object</TD
364></TR
365></TABLE
366></DIV
367></BODY
368></HTML
369>
Note: See TracBrowser for help on using the repository browser.