reference/mysqli/mysqli_result/fetch-fields.xml
5152c78db935ea2463e20a01ae0e3f3573314d78
...
...
@@ -10,12 +10,12 @@
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>array</type><methodname>mysqli_result::fetch_fields</methodname>
15
15
<void/>
16
16
</methodsynopsis>
17
17
<para>&style.procedural;</para>
18
-
<methodsynopsis role="procedural">
18
+
<methodsynopsis>
19
19
<type>array</type><methodname>mysqli_fetch_fields</methodname>
20
20
<methodparam><type>mysqli_result</type><parameter>result</parameter></methodparam>
21
21
</methodsynopsis>
...
...
@@ -40,11 +40,10 @@
40
40
<refsect1 role="returnvalues">
41
41
&reftitle.returnvalues;
42
42
<para>
43
-
Returns an array of objects which contains field definition information or
44
-
&false; if no field information is available.
43
+
Returns an array of objects containing field definition information.
45
44
</para>
46
-
<para>
47
-
<table xml:id="mysqli-result.fetch-fields.returnvalues">
45
+

46
+
<table>
48
47
<title>Object properties</title>
49
48
<tgroup cols="2">
50
49
<thead>
...
...
@@ -71,21 +70,35 @@
71
70
<entry>Original table name if an alias was specified</entry>
72
71
</row>
73
72
<row>
73
+
<entry>def</entry>
74
+
<entry>Unused. Always an empty string</entry>
75
+
</row>
76
+
<row>
77
+
<entry>db</entry>
78
+
<entry>The name of the database</entry>
79
+
</row>
80
+
<row>
81
+
<entry>catalog</entry>
82
+
<entry>Unused. Always <literal>"def"</literal></entry>
83
+
</row>
84
+
<row>
74
85
<entry>max_length</entry>
75
-
<entry>The maximum width of the field for the result set.</entry>
86
+
<entry>The maximum width of the field for the result set. As of PHP 8.1, this value is always <literal>0</literal>.</entry>
76
87
</row>
77
88
<row>
78
89
<entry>length</entry>
79
90
<entry>
80
-
The width of the field, in bytes, as specified in the table definition. Note that
81
-
this number (bytes) might differ from your table definition value (characters), depending on
82
-
the character set you use. For example, the character set utf8 has 3 bytes per character,
83
-
so varchar(10) will return a length of 30 for utf8 (10*3), but return 10 for latin1 (10*1).
91
+
The width of the field in bytes. For string columns,
92
+
the length value varies on the connection character set. For example,
93
+
if the character set is <literal>latin1</literal>, a single-byte character set,
94
+
the length value for a <literal>SELECT 'abc'</literal> query is 3.
95
+
If the character set is <literal>utf8mb4</literal>, a multibyte character
96
+
set in which characters take up to 4 bytes, the length value is 12.
84
97
</entry>
85
98
</row>
86
99
<row>
87
100
<entry>charsetnr</entry>
88
-
<entry>The character set number (id) for the field.</entry>
101
+
<entry>The character set number for the field.</entry>
89
102
</row>
90
103
<row>
91
104
<entry>flags</entry>
...
...
@@ -97,12 +110,11 @@
97
110
</row>
98
111
<row>
99
112
<entry>decimals</entry>
100
-
<entry>The number of decimals used (for integer fields)</entry>
113
+
<entry>The number of decimals for numeric fields, and the fractional seconds precision for temporal fields.</entry>
101
114
</row>
102
115
</tbody>
103
116
</tgroup>
104
117
</table>
105
-
</para>
106
118
</refsect1>
107
119

108
120
<refsect1 role="examples">
109
121