-
Notifications
You must be signed in to change notification settings - Fork 866
Expand file tree
/
Copy pathsetattribute.xml
More file actions
305 lines (300 loc) · 8.95 KB
/
setattribute.xml
File metadata and controls
305 lines (300 loc) · 8.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="pdo.setattribute" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>PDO::setAttribute</refname>
<refpurpose>
Set an attribute
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="PDO">
<modifier>public</modifier> <type>bool</type><methodname>PDO::setAttribute</methodname>
<methodparam><type>int</type><parameter>attribute</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Sets an attribute on the database handle. Some available generic
attributes are listed below; some drivers may make use of
additional driver specific attributes.
Note that driver specific attributes <emphasis>must not</emphasis> be used
with other drivers.
<variablelist>
<varlistentry>
<term><constant>PDO::ATTR_CASE</constant></term>
<listitem>
<para>
Force column names to a specific case.
Can take one of the following values:
</para>
<variablelist>
<varlistentry>
<term><constant>PDO::CASE_LOWER</constant></term>
<listitem>
<simpara>
Force column names to lower case.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::CASE_NATURAL</constant></term>
<listitem>
<simpara>
Leave column names as returned by the database driver.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::CASE_UPPER</constant></term>
<listitem>
<simpara>
Force column names to upper case.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ATTR_ERRMODE</constant></term>
<listitem>
<para>
Error reporting mode of PDO.
Can take one of the following values:
</para>
<variablelist>
<varlistentry>
<term><constant>PDO::ERRMODE_SILENT</constant></term>
<listitem>
<simpara>
Only sets error codes.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ERRMODE_WARNING</constant></term>
<listitem>
<simpara>
Raises <constant>E_WARNING</constant> diagnostics.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ERRMODE_EXCEPTION</constant></term>
<listitem>
<simpara>
Throws <classname>PDOException</classname>s.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ATTR_ORACLE_NULLS</constant></term>
<listitem>
<note>
<simpara>
This attribute is available with all drivers, not just Oracle.
</simpara>
</note>
<para>
Determines if and how &null; and empty strings should be converted.
Can take one of the following values:
</para>
<variablelist>
<varlistentry>
<term><constant>PDO::NULL_NATURAL</constant></term>
<listitem>
<simpara>
No conversion takes place.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::NULL_EMPTY_STRING</constant></term>
<listitem>
<simpara>
Empty strings get converted to &null;.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::NULL_TO_STRING</constant></term>
<listitem>
<simpara>
&null; gets converted to an empty string.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ATTR_STRINGIFY_FETCHES</constant></term>
<listitem>
<para>
Controls whether fetched values (except &null;) are converted to strings.
Takes a value of type <type>bool</type>: &true; to enable and &false; to
disable (default).
&null; values remain unchanged unless <constant>PDO::ATTR_ORACLE_NULLS</constant>
is set to <constant>PDO::NULL_TO_STRING</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ATTR_STATEMENT_CLASS</constant></term>
<listitem>
<para>
Set user-supplied statement class derived from PDOStatement.
<!-- TODO improve description of the value it takes, or refer to other docs -->
Requires <literal>array(string classname, array(mixed constructor_args))</literal>.
</para>
<caution>
<simpara>
Cannot be used with persistent PDO instances.
</simpara>
</caution>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ATTR_TIMEOUT</constant></term>
<listitem>
<para>
Specifies the timeout duration in seconds.
Takes a value of type <type>int</type>.
</para>
<note>
<para>
Not all drivers support this option, and its meaning may differ from
driver to driver. For example, SQLite will wait for up to this time
value before giving up on obtaining a writable lock, but other drivers
may interpret this as a connection or a read timeout interval.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ATTR_AUTOCOMMIT</constant></term>
<listitem>
<note>
<simpara>
Only available for the OCI, Firebird, and MySQL drivers.
</simpara>
</note>
<para>
Whether to autocommit every single statement.
Takes a value of type <type>bool</type>: &true; to enable and
&false; to disable. By default, &true;.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ATTR_EMULATE_PREPARES</constant></term>
<listitem>
<note>
<simpara>
Only available for the OCI, Firebird, and MySQL drivers.
</simpara>
</note>
<para>
Whether enable or disable emulation of prepared statements.
Some drivers do not support prepared statements natively or have
limited support for them.
If set to &true; PDO will always emulate prepared statements,
otherwise PDO will attempt to use native prepared statements.
In case the driver cannot successfully prepare the current query,
PDO will always fall back to emulating the prepared statement.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::MYSQL_ATTR_USE_BUFFERED_QUERY</constant></term>
<listitem>
<note>
<simpara>
Only available for the MySQL driver.
</simpara>
</note>
<para>
Whether to use buffered queries.
Takes a value of type <type>bool</type>: &true; to enable and
&false; to disable. By default, &true;.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>PDO::ATTR_DEFAULT_FETCH_MODE</constant></term>
<listitem>
<para>
Set the default fetch mode.
A description of the modes and how to use them is available in the
<methodname>PDOStatement::fetch</methodname> documentation.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>attribute</parameter></term>
<listitem>
<para>
The attribute to modify.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
The value to set the <parameter>attribute</parameter>,
might require a specific type depending on the attribute.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>PDO::getAttribute</function></member>
<member><function>PDOStatement::getAttribute</function></member>
<member><function>PDOStatement::setAttribute</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->