reference/pdo_mysql/constants.xml
cb14980cc2b64fdb2f04d8d49e09f8d374815c35
...
...
@@ -7,25 +7,27 @@
7
7
<varlistentry xml:id="pdo.constants.mysql-attr-use-buffered-query">
8
8
<term>
9
9
<constant>PDO::MYSQL_ATTR_USE_BUFFERED_QUERY</constant>
10
-
(<type>integer</type>)
10
+
(<type>bool</type>)
11
11
</term>
12
12
<listitem>
13
13
<simpara>
14
-
If this attribute is set to &true; on a
15
-
<classname>PDOStatement</classname>, the MySQL driver will use the
16
-
buffered versions of the MySQL API. If you're writing portable code, you
17
-
should use <function>PDOStatement::fetchAll</function> instead.
14
+
By default all statements are executed in
15
+
<link linkend="mysqlinfo.concepts.buffering">buffered mode</link>.
16
+
If this attribute is set to &false; on a
17
+
<classname>PDO</classname> object, the MySQL driver will use the
18
+
unbuffered mode.
18
19
</simpara>
19
20
<para>
20
-
<example><title>Forcing queries to be buffered in mysql</title>
21
+
<example><title>Setting MySQL unbuffered mode</title>
21
22
<programlisting role="php">
22
23
<![CDATA[
23
24
<?php
24
-
if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
25
-
$stmt = $db->prepare('select * from foo',
26
-
array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
27
-
} else {
28
-
die("my application only works with mysql; I should use \$stmt->fetchAll() instead");
25
+
$pdo = new PDO("mysql:host=localhost;dbname=world", 'my_user', 'my_password');
26
+
$pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
27
+

28
+
$unbufferedResult = $pdo->query("SELECT Name FROM City");
29
+
foreach ($unbufferedResult as $row) {
30
+
echo $row['Name'] . PHP_EOL;
29
31
}
30
32
?>
31
33
]]>
...
...
@@ -37,7 +39,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
37
39
<varlistentry xml:id="pdo.constants.mysql-attr-local-infile">
38
40
<term>
39
41
<constant>PDO::MYSQL_ATTR_LOCAL_INFILE</constant>
40
-
(<type>integer</type>)
42
+
(<type>int</type>)
41
43
</term>
42
44
<listitem>
43
45
<para>
...
...
@@ -49,10 +51,26 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
49
51
</para>
50
52
</listitem>
51
53
</varlistentry>
54
+
<varlistentry xml:id="pdo.constants.mysql-attr-local-infile-directory">
55
+
<term>
56
+
<constant>PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY</constant>
57
+
(<type>string</type>)
58
+
</term>
59
+
<listitem>
60
+
<para>
61
+
Allows restricting LOCAL DATA loading to files located in this designated
62
+
directory. Available as of PHP 8.1.0.
63
+
</para>
64
+
<para>
65
+
Note, this constant can only be used in the <parameter>driver_options</parameter>
66
+
array when constructing a new database handle.
67
+
</para>
68
+
</listitem>
69
+
</varlistentry>
52
70
<varlistentry xml:id="pdo.constants.mysql-attr-init-command">
53
71
<term>
54
72
<constant>PDO::MYSQL_ATTR_INIT_COMMAND</constant>
55
-
(<type>integer</type>)
73
+
(<type>string</type>)
56
74
</term>
57
75
<listitem>
58
76
<para>
...
...
@@ -68,7 +86,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
68
86
<varlistentry xml:id="pdo.constants.mysql-attr-read-default-file">
69
87
<term>
70
88
<constant>PDO::MYSQL_ATTR_READ_DEFAULT_FILE</constant>
71
-
(<type>integer</type>)
89
+
(<type>int</type>)
72
90
</term>
73
91
<listitem>
74
92
<para>
...
...
@@ -82,7 +100,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
82
100
<varlistentry xml:id="pdo.constants.mysql-attr-read-default-group">
83
101
<term>
84
102
<constant>PDO::MYSQL_ATTR_READ_DEFAULT_GROUP</constant>
85
-
(<type>integer</type>)
103
+
(<type>int</type>)
86
104
</term>
87
105
<listitem>
88
106
<para>
...
...
@@ -96,7 +114,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
96
114
<varlistentry xml:id="pdo.constants.mysql-attr-max-buffer-size">
97
115
<term>
98
116
<constant>PDO::MYSQL_ATTR_MAX_BUFFER_SIZE</constant>
99
-
(<type>integer</type>)
117
+
(<type>int</type>)
100
118
</term>
101
119
<listitem>
102
120
<para>
...
...
@@ -108,7 +126,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
108
126
<varlistentry xml:id="pdo.constants.mysql-attr-direct-query">
109
127
<term>
110
128
<constant>PDO::MYSQL_ATTR_DIRECT_QUERY</constant>
111
-
(<type>integer</type>)
129
+
(<type>int</type>)
112
130
</term>
113
131
<listitem>
114
132
<para>
...
...
@@ -119,7 +137,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
119
137
<varlistentry xml:id="pdo.constants.mysql-attr-found-rows">
120
138
<term>
121
139
<constant>PDO::MYSQL_ATTR_FOUND_ROWS</constant>
122
-
(<type>integer</type>)
140
+
(<type>int</type>)
123
141
</term>
124
142
<listitem>
125
143
<para>
...
...
@@ -131,7 +149,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
131
149
<varlistentry xml:id="pdo.constants.mysql-attr-ignore-space">
132
150
<term>
133
151
<constant>PDO::MYSQL_ATTR_IGNORE_SPACE</constant>
134
-
(<type>integer</type>)
152
+
(<type>int</type>)
135
153
</term>
136
154
<listitem>
137
155
<para>
...
...
@@ -143,12 +161,11 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
143
161
<varlistentry xml:id="pdo.constants.mysql-attr-compress">
144
162
<term>
145
163
<constant>PDO::MYSQL_ATTR_COMPRESS</constant>
146
-
(<type>integer</type>)
164
+
(<type>int</type>)
147
165
</term>
148
166
<listitem>
149
167
<para>
150
-
Enable network communication compression. This is also supported when
151
-
compiled against mysqlnd as of PHP 5.3.11.
168
+
Enable network communication compression.
152
169
</para>
153
170
</listitem>
154
171
</varlistentry>
...
...
@@ -156,30 +173,24 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
156
173
<varlistentry xml:id="pdo.constants.mysql-attr-ssl-ca">
157
174
<term>
158
175
<constant>PDO::MYSQL_ATTR_SSL_CA</constant>
159
-
(<type>integer</type>)
176
+
(<type>int</type>)
160
177
</term>
161
178
<listitem>
162
179
<para>
163
180
The file path to the SSL certificate authority.
164
181
</para>
165
-
<para>
166
-
&version.exists.asof; 5.3.7.
167
-
</para>
168
182
</listitem>
169
183
</varlistentry>
170
184

171
185
<varlistentry xml:id="pdo.constants.mysql-attr-ssl-capath">
172
186
<term>
173
187
<constant>PDO::MYSQL_ATTR_SSL_CAPATH</constant>
174
-
(<type>integer</type>)
188
+
(<type>int</type>)
175
189
</term>
176
190
<listitem>
177
191
<para>
178
192
The file path to the directory that contains the trusted SSL
179
-
CA certificates, which are stored in PEM format.
180
-
</para>
181
-
<para>
182
-
&version.exists.asof; 5.3.7.
193
+
CA certificates, which are stored in <acronym>PEM</acronym> format.
183
194
</para>
184
195
</listitem>
185
196
</varlistentry>
...
...
@@ -187,45 +198,52 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
187
198
<varlistentry xml:id="pdo.constants.mysql-attr-ssl-cert">
188
199
<term>
189
200
<constant>PDO::MYSQL_ATTR_SSL_CERT</constant>
190
-
(<type>integer</type>)
201
+
(<type>int</type>)
191
202
</term>
192
203
<listitem>
193
204
<para>
194
205
The file path to the SSL certificate.
195
206
</para>
196
-
<para>
197
-
&version.exists.asof; 5.3.7.
198
-
</para>
199
207
</listitem>
200
208
</varlistentry>
201
209

202
-
<varlistentry xml:id="pdo.constants.mysql-attr-cipher">
210
+
<varlistentry xml:id="pdo.constants.mysql-attr-ssl-cipher">
203
211
<term>
204
212
<constant>PDO::MYSQL_ATTR_SSL_CIPHER</constant>
205
-
(<type>integer</type>)
213
+
(<type>int</type>)
206
214
</term>
207
215
<listitem>
208
216
<para>
209
217
A list of one or more permissible ciphers to use for SSL encryption, in a format
210
218
understood by OpenSSL. For example: <literal>DHE-RSA-AES256-SHA:AES128-SHA</literal>
211
219
</para>
212
-
<para>
213
-
&version.exists.asof; 5.3.7.
214
-
</para>
215
220
</listitem>
216
221
</varlistentry>
217
222

218
-
<varlistentry xml:id="pdo.constants.mysql-attr-key">
223
+
<varlistentry xml:id="pdo.constants.mysql-attr-ssl-key">
219
224
<term>
220
225
<constant>PDO::MYSQL_ATTR_SSL_KEY</constant>
221
-
(<type>integer</type>)
226
+
(<type>int</type>)
222
227
</term>
223
228
<listitem>
224
229
<para>
225
230
The file path to the SSL key.
226
231
</para>
232
+
</listitem>
233
+
</varlistentry>
234
+

235
+
<varlistentry xml:id="pdo.constants.mysql-attr-ssl-verify-server-cert">
236
+
<term>
237
+
<constant>PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT</constant>
238
+
(<type>int</type>)
239
+
</term>
240
+
<listitem>
227
241
<para>
228
-
&version.exists.asof; 5.3.7.
242
+
Provides a way to disable verification of the server SSL certificate.
243
+
This option is available only with mysqlnd.
244
+
</para>
245
+
<para>
246
+
&version.exists.asof; 7.0.18 and PHP 7.1.4.
229
247
</para>
230
248
</listitem>
231
249
</varlistentry>
...
...
@@ -233,7 +251,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
233
251
<varlistentry xml:id="pdo.constants.mysql-attr-multi-statements">
234
252
<term>
235
253
<constant>PDO::MYSQL_ATTR_MULTI_STATEMENTS</constant>
236
-
(<type>integer</type>)
254
+
(<type>int</type>)
237
255
</term>
238
256
<listitem>
239
257
<para>
...
...
@@ -244,9 +262,6 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
244
262
Note, this constant can only be used in the <parameter>driver_options</parameter>
245
263
array when constructing a new database handle.
246
264
</para>
247
-
<para>
248
-
&version.exists.asof; 5.5.21 and PHP 5.6.5.
249
-
</para>
250
265
</listitem>
251
266
</varlistentry>
252
267

253
268