1 |
efrain |
1 |
ADOdb Library for PHP
|
|
|
2 |
======================
|
|
|
3 |
|
|
|
4 |
[](https://gitter.im/adodb/adodb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
|
5 |
[](https://sourceforge.net/projects/adodb/files/latest/download)
|
|
|
6 |
[](https://packagist.org/packages/adodb/adodb-php)
|
|
|
7 |
|
|
|
8 |
(c) 2000-2013 John Lim (jlim@natsoft.com)
|
|
|
9 |
(c) 2014 Damien Regad, Mark Newnham and the
|
|
|
10 |
[ADOdb community](https://github.com/ADOdb/ADOdb/graphs/contributors)
|
|
|
11 |
|
|
|
12 |
The ADOdb Library is dual-licensed, released under both the
|
|
|
13 |
[BSD 3-Clause](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#bsd-3-clause-license)
|
|
|
14 |
and the
|
|
|
15 |
[GNU Lesser General Public Licence (LGPL) v2.1](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#gnu-lesser-general-public-license)
|
|
|
16 |
or, at your option, any later version.
|
|
|
17 |
This means you can use it in proprietary products;
|
|
|
18 |
see [License](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md) for details.
|
|
|
19 |
|
|
|
20 |
Home page: https://adodb.org/
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
Introduction
|
|
|
24 |
============
|
|
|
25 |
|
|
|
26 |
PHP's database access functions are not standardized. This creates a
|
|
|
27 |
need for a database class library to hide the differences between the
|
|
|
28 |
different databases (encapsulate the differences) so we can easily
|
|
|
29 |
switch databases.
|
|
|
30 |
|
|
|
31 |
The library currently supports MySQL, Firebird & Interbase, PostgreSQL, SQLite3, Oracle,
|
|
|
32 |
Microsoft SQL Server, Foxpro ODBC, Access ODBC, Informix, DB2, Sybase,
|
|
|
33 |
Sybase SQL Anywhere, generic ODBC and Microsoft's ADO.
|
|
|
34 |
|
|
|
35 |
We hope more people will contribute drivers to support other databases.
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
Installation
|
|
|
39 |
============
|
|
|
40 |
|
|
|
41 |
Unpack all the files into a directory accessible by your web server.
|
|
|
42 |
|
|
|
43 |
To test, try modifying some of the tutorial examples.
|
|
|
44 |
Make sure you customize the connection settings correctly.
|
|
|
45 |
|
|
|
46 |
You can debug using:
|
|
|
47 |
|
|
|
48 |
``` php
|
|
|
49 |
<?php
|
|
|
50 |
include('adodb/adodb.inc.php');
|
|
|
51 |
|
|
|
52 |
$db = adoNewConnection($driver); # eg. 'mysqli' or 'oci8'
|
|
|
53 |
$db->debug = true;
|
|
|
54 |
$db->connect($server, $user, $password, $database);
|
|
|
55 |
$rs = $db->execute('select * from some_small_table');
|
|
|
56 |
print "<pre>";
|
|
|
57 |
print_r($rs->getRows());
|
|
|
58 |
print "</pre>";
|
|
|
59 |
```
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
Documentation and Examples
|
|
|
63 |
==========================
|
|
|
64 |
|
|
|
65 |
Refer to the [ADOdb website](https://adodb.org/) for library documentation and examples. The documentation can also be [downloaded for offline viewing](https://sourceforge.net/projects/adodb/files/Documentation/).
|
|
|
66 |
|
|
|
67 |
- [Main documentation](https://adodb.org/dokuwiki/doku.php?id=v5:userguide:userguide_index): Query, update and insert records using a portable API.
|
|
|
68 |
- [Data dictionary](https://adodb.org/dokuwiki/doku.php?id=v5:dictionary:dictionary_index) describes how to create database tables and indexes in a portable manner.
|
|
|
69 |
- [Database performance monitoring](https://adodb.org/dokuwiki/doku.php?id=v5:performance:performance_index) allows you to perform health checks, tune and monitor your database.
|
|
|
70 |
- [Database-backed sessions](https://adodb.org/dokuwiki/doku.php?id=v5:session:session_index).
|
|
|
71 |
|
|
|
72 |
There is also a [tutorial](https://adodb.org/dokuwiki/doku.php?id=v5:userguide:mysql_tutorial) that contrasts ADOdb code with PHP native MySQL code.
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
Files
|
|
|
76 |
=====
|
|
|
77 |
|
|
|
78 |
- `adodb.inc.php` is the library's main file. You only need to include this file.
|
|
|
79 |
- `adodb-*.inc.php` are the database specific driver code.
|
|
|
80 |
- `adodb-session.php` is the PHP4 session handling code.
|
|
|
81 |
- `test.php` contains a list of test commands to exercise the class library.
|
|
|
82 |
- `testdatabases.inc.php` contains the list of databases to apply the tests on.
|
|
|
83 |
- `Benchmark.php` is a simple benchmark to test the throughput of a SELECT
|
|
|
84 |
statement for databases described in testdatabases.inc.php. The benchmark
|
|
|
85 |
tables are created in test.php.
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
Support
|
|
|
89 |
=======
|
|
|
90 |
|
|
|
91 |
To discuss with the ADOdb development team and users, connect to our
|
|
|
92 |
[Gitter chatroom](https://gitter.im/adodb/adodb) using your Github credentials.
|
|
|
93 |
|
|
|
94 |
Please report bugs, issues and feature requests on Github:
|
|
|
95 |
|
|
|
96 |
https://github.com/ADOdb/ADOdb/issues
|
|
|
97 |
|
|
|
98 |
You may also find legacy issues in
|
|
|
99 |
|
|
|
100 |
- the [SourceForge tickets section](http://sourceforge.net/p/adodb/_list/tickets)
|
|
|
101 |
|
|
|
102 |
However, please note that they are not actively monitored and should
|
|
|
103 |
only be used as reference.
|