-
Notifications
You must be signed in to change notification settings - Fork 860
Expand file tree
/
Copy pathreference.xml
More file actions
218 lines (208 loc) · 6.96 KB
/
reference.xml
File metadata and controls
218 lines (208 loc) · 6.96 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
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<reference xml:id="ref.pdo-odbc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<?phpdoc extension-membership="bundledexternal" ?>
<title>ODBC and DB2 PDO Driver (PDO_ODBC)</title>
<titleabbrev>ODBC and DB2 PDO Driver</titleabbrev>
<partintro>
<section xml:id="ref.pdo-odbc.intro">
&reftitle.intro;
<para>
PDO_ODBC is a driver that implements the <link linkend="intro.pdo">PHP Data
Objects (PDO) interface</link>
to enable access from PHP to databases through ODBC drivers or through the
IBM DB2 Call Level Interface (DB2 CLI) library. PDO_ODBC currently supports
three different "flavours" of database drivers:
<variablelist>
<varlistentry>
<term>ibm-db2</term>
<listitem>
<para>
Supports access to IBM DB2 Universal Database, Cloudscape, and Apache
Derby servers through the free DB2 express-C client.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>unixODBC</term>
<listitem>
<para>
Supports access to database servers through the unixODBC driver
manager and the database's own ODBC drivers.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>generic</term>
<listitem>
<para>
Offers a compile option for ODBC driver managers that are not
explicitly supported by PDO_ODBC.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
On Windows, <filename>php_pdo_odbc.dll</filename> has to be enabled as
extension in &php.ini;. It is linked
against the Windows ODBC Driver Manager so that PHP can connect to any
database cataloged as a System DSN.
</para>
</section>
<!-- Information found in configure.xml -->
&reference.pdo-odbc.configure;
<!-- Information found in constants.xml -->
&reference.pdo-odbc.constants;
<!-- Information found in ini.xml -->
&reference.pdo-odbc.ini;
</partintro>
<refentry xml:id="ref.pdo-odbc.connection">
<refnamediv>
<refname>PDO_ODBC DSN</refname>
<refpurpose>Connecting to ODBC or DB2 databases</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>
The PDO_ODBC Data Source Name (DSN) is composed of the following elements:
<variablelist>
<varlistentry>
<term>DSN prefix</term>
<listitem>
<para>
The DSN prefix is <userinput>odbc:</userinput>. If you are connecting
to a database cataloged in the ODBC driver manager or the DB2 catalog,
you can append the cataloged name of the database to the DSN.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DSN</term>
<listitem>
<para>
The name of the database as cataloged in the ODBC driver manager or
the DB2 catalog. Alternately, you can provide a complete ODBC
connection string to connect to a database as described at
<link xlink:href="&url.connectionstrings;">&url.connectionstrings;</link>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>UID</literal></term>
<listitem>
<para>
The name of the user for the connection. If you specify the user name
in the DSN, PDO ignores the value of the user name argument in the
PDO constructor.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>PWD</literal></term>
<listitem>
<para>
The password of the user for the connection. If you specify the
password in the DSN, PDO ignores the value of the password argument
in the PDO constructor.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
When passing an empty <type>string</type> to the password argument in the PDO constructor, <literal>pwd</literal>
was not included in the connection string created until now, but the behavior has been changed to include
it as an empty string. Passing &null; for the password argument in the PDO constructor results in the same
behavior as before.
</entry>
</row>
<row>
<entry>8.4.0</entry>
<entry>
Changed the behavior to ignore the user name argument and the password argument in the PDO constructor
separately when the DSN contains <literal>uid</literal> or <literal>pwd</literal>.
Previously, if included only either <literal>uid</literal> or <literal>pwd</literal> in the DSN,
both the user name argument and the password argument in the PDO constructor were ignored.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>PDO_ODBC DSN example (ODBC driver manager)</title>
<para>
The following example shows a PDO_ODBC DSN for connecting to
an ODBC database cataloged as testdb in the ODBC driver manager:
</para>
<programlisting><![CDATA[
odbc:testdb
]]>
</programlisting>
</example>
<example>
<title>PDO_ODBC DSN example (IBM DB2 uncataloged connection)</title>
<para>
The following example shows a PDO_ODBC DSN for connecting to
an IBM DB2 database named <userinput>SAMPLE</userinput> using the full
ODBC DSN syntax:
</para>
<programlisting><![CDATA[
odbc:DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME=localhost;PORT=50000;DATABASE=SAMPLE;PROTOCOL=TCPIP;UID=db2inst1;PWD=ibmdb2;
]]>
</programlisting>
</example>
<example>
<title>PDO_ODBC DSN example (Microsoft Access uncataloged connection)</title>
<para>
The following example shows a PDO_ODBC DSN for connecting to
a Microsoft Access database stored at <userinput>C:\db.mdb</userinput> using the full
ODBC DSN syntax:
</para>
<programlisting><![CDATA[
odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\db.mdb;Uid=Admin
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
</reference>
<!-- 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
-->