reference/mysqli/mysqli_result/fetch-fields.xml
5152c78db935ea2463e20a01ae0e3f3573314d78
...
...
@@ -42,8 +42,8 @@
42
42
<para>
43
43
Returns an array of objects containing field definition information.
44
44
</para>
45
-
<para>
46
-
<table xml:id="mysqli-result.fetch-fields.returnvalues">
45
+

46
+
<table>
47
47
<title>Object properties</title>
48
48
<tgroup cols="2">
49
49
<thead>
...
...
@@ -70,21 +70,35 @@
70
70
<entry>Original table name if an alias was specified</entry>
71
71
</row>
72
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>
73
85
<entry>max_length</entry>
74
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>
75
87
</row>
76
88
<row>
77
89
<entry>length</entry>
78
90
<entry>
79
-
The width of the field, in bytes, as specified in the table definition. Note that
80
-
this number (bytes) might differ from your table definition value (characters), depending on
81
-
the character set you use. For example, the character set utf8 has 3 bytes per character,
82
-
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.
83
97
</entry>
84
98
</row>
85
99
<row>
86
100
<entry>charsetnr</entry>
87
-
<entry>The character set number (id) for the field.</entry>
101
+
<entry>The character set number for the field.</entry>
88
102
</row>
89
103
<row>
90
104
<entry>flags</entry>
...
...
@@ -96,12 +110,11 @@
96
110
</row>
97
111
<row>
98
112
<entry>decimals</entry>
99
-
<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>
100
114
</row>
101
115
</tbody>
102
116
</tgroup>
103
117
</table>
104
-
</para>
105
118
</refsect1>
106
119

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