reference/mysqli/mysqli_result/fetch-assoc.xml
035c126c0393fe154bac46e2c3c489ebadce48a5
...
...
@@ -4,24 +4,34 @@
4
4
<refnamediv>
5
5
<refname>mysqli_result::fetch_assoc</refname>
6
6
<refname>mysqli_fetch_assoc</refname>
7
-
<refpurpose>Fetch a result row as an associative array</refpurpose>
7
+
<refpurpose>Fetch the next row of a result set as an associative array</refpurpose>
8
8
</refnamediv>
9
9

10
10
<refsect1 role="description">
11
11
&reftitle.description;
12
12
<para>&style.oop;</para>
13
-
<methodsynopsis role="oop">
13
+
<methodsynopsis role="mysqli_result">
14
14
<modifier>public</modifier> <type class="union"><type>array</type><type>null</type><type>false</type></type><methodname>mysqli_result::fetch_assoc</methodname>
15
15
<void/>
16
16
</methodsynopsis>
17
17
<para>&style.procedural;</para>
18
-
<methodsynopsis role="procedural">
18
+
<methodsynopsis>
19
19
<type class="union"><type>array</type><type>null</type><type>false</type></type><methodname>mysqli_fetch_assoc</methodname>
20
20
<methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam>
21
21
</methodsynopsis>
22
22
<para>
23
-
Returns an associative array that corresponds to the fetched row or &null;
24
-
if there are no more rows.
23
+
Fetches one row of data from the result set and returns it as an associative
24
+
array.
25
+
Each subsequent call to this function will return the next row within the
26
+
result set, or &null; if there are no more rows.
27
+
</para>
28
+
<para>
29
+
If two or more columns of the result have the same name, the last
30
+
column will take precedence and overwrite any previous data. To
31
+
access multiple columns with the same name,
32
+
<function>mysqli_fetch_row</function> may be used to fetch the numerically
33
+
indexed array, or aliases may be used in the SQL query select list to give
34
+
columns different names.
25
35
</para>
26
36
&database.field-case;
27
37
&database.fetch-null;
...
...
@@ -39,15 +49,10 @@
39
49
<refsect1 role="returnvalues">
40
50
&reftitle.returnvalues;
41
51
<para>
42
-
Returns an associative array of values representing the fetched row in the result
43
-
set, where each key in the array represents the name of one of the result
44
-
set's columns or &null; if there are no more rows in result set.
45
-
</para>
46
-
<para>
47
-
If two or more columns of the result have the same field names, the last
48
-
column will take precedence. To access the other column(s) of the same
49
-
name, you either need to access the result with numeric indices by using
50
-
<function>mysqli_fetch_row</function> or add alias names.
52
+
Returns an associative array representing the fetched row,
53
+
where each key in the array represents the name of one of the result
54
+
set's columns, &null; if there
55
+
are no more rows in the result set, &return.falseforfailure;.
51
56
</para>
52
57
</refsect1>
53
58

...
...
@@ -158,6 +163,7 @@ Santa Clara (USA)
158
163
<para>
159
164
<simplelist>
160
165
<member><function>mysqli_fetch_array</function></member>
166
+
<member><function>mysqli_fetch_column</function></member>
161
167
<member><function>mysqli_fetch_row</function></member>
162
168
<member><function>mysqli_fetch_object</function></member>
163
169
<member><function>mysqli_query</function></member>
164
170