File: databases.xml

package info (click to toggle)
php-doc 20241205~git.dfcbb86%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 70,956 kB
  • sloc: xml: 968,269; php: 23,883; javascript: 671; sh: 177; makefile: 37
file content (170 lines) | stat: -rw-r--r-- 6,271 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
 <chapter xml:id="faq.databases" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
  <title>Database issues</title>
  <titleabbrev>Database issues</titleabbrev>

  <para>
   This section holds common questions about relation between
   PHP and databases. Yes, PHP can access virtually any
   database available today.
  </para>

  <qandaset>
   <qandaentry xml:id="faq.databases.mssql">
    <question>
     <para>
      I heard it's possible to access Microsoft SQL Server from PHP. How?
     </para>
    </question>
    <answer>
     <para>
      On Unix machines you can use <link linkend="ref.pdo-odbc">PDO_ODBC</link>
      or the <link linkend="book.uodbc">Unified ODBC API</link>.
     </para>
     <para>
      On Windows machines you can also use <link linkend="ref.pdo-sqlsrv">PDO_SQLSRV</link>
      or <link linkend="book.sqlsrv">SQLSRV</link>.
     </para>
     <para>
      Also see the answer to the next question.
     </para>
    </answer>
   </qandaentry>

   <qandaentry xml:id="faq.databases.access">
    <question>
     <para>Can I access Microsoft Access databases?</para>
    </question>
    <answer>
     <para>
      If you are running PHP on a Unix box and want to talk to MS Access
      on a Windows box you will need Unix ODBC drivers.
      <link xlink:href="&url.openlink;">OpenLink Software</link> has Unix-based
      ODBC drivers that can do this.
     </para>
     <para>
      Another alternative is to use an SQL server that has
      Windows ODBC drivers and use that to store the data, which you can
      then access from Microsoft Access (using ODBC) and PHP (using the
      built in drivers), or to use an intermediary file format that Access
      and PHP both understand, such as flat files or dBase databases.
      On this point Tim Hayes from OpenLink software writes:
      <blockquote>
       <para>
        Using another database as an intermediary is not a good idea, when you can
        use ODBC from PHP straight to your database - i.e. with OpenLink's drivers. If
        you do need to use an intermediary file format, OpenLink have now released
        Virtuoso (a virtual database engine) for NT, Linux and other Unix platforms.
        Please visit our <link xlink:href="&url.openlink;">website</link> for a free download.
       </para>
      </blockquote>
     </para>
     <para>
      One option that has proved successful is to use MySQL and its
      MyODBC drivers on Windows and synchronizing the databases. Steve Lawrence
      writes:
     </para>
     <para>
      <itemizedlist>
       <listitem>
        <simpara>
         Install MySQL on your platform according to instructions with MySQL.
         Latest available from <link xlink:href="&url.mysql;">&url.mysql;</link>
         No special configuration required except when you set up a database, and configure the
         user account, you should put % in the host field, or the host name of the
         Windows computer you wish to access MySQL with. Make a note of your server
         name, username, and password.
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         Download the MyODBC for Windows driver from the MySQL site.
         Install it on your Windows machine. You can test the operation with
         the utilities included with this program.
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         Create a user or system dsn in your ODBC administrator, located in the
         control panel. Make up a dsn name, enter your hostname, user name, password,
         port, etc for you MySQL database configured in step 1.
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         Install Access with a full install, this makes sure you get the proper
         add-ins... at the least you will need ODBC support and the linked table
         manager.
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         Now the fun part! Create a new access database. In the table
         window right click and select Link Tables, or under the file
         menu option, select Get External Data and then Link Tables.
         When the file browser box comes up, select files of type: ODBC.
         Select System dsn and the name of your dsn created in step 3.
         Select the table to link, press OK, and presto! You can now
         open the table and add/delete/edit data on your MySQL server!
         You can also build queries, import/export tables to MySQL,
         build forms and reports, etc.
        </simpara>
       </listitem>
      </itemizedlist>
     </para>
     <para>
      Tips and Tricks:
      <itemizedlist>
       <listitem>
        <simpara>
         You can construct your tables in Access and export them
         to MySQL, then link them back in. That makes table
         creation quick.
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         When creating tables in Access, you must have a primary
         key defined in order to have write access to the table in
         access. Make sure you create a primary key in MySQL before
         linking in access
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         If you change a table in MySQL, you have to re-link it
         in Access. Go to tools&gt;add-ins&gt;linked table manager,
         cruise to your ODBC DSN, and select the table to re-link
         from there. you can also move your dsn source around there,
         just hit the always prompt for new location checkbox before
         pressing OK.
        </simpara>
       </listitem>
      </itemizedlist>
     </para>
    </answer>
   </qandaentry>
  </qandaset>
 </chapter>

<!-- 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
-->