The name below is the value you pass to NewADOConnection($name) to create a connection object for that database.
Name
Tested
Database
RecordCount() usable
Prerequisites
Operating Systems
access
B
Microsoft Access/Jet. You need to create an ODBC DSN.
Y/N
ODBC
Windows only
ado
B
Generic ADO, not tuned for specific databases. Allows DSN-less connections. For best performance, use an OLEDB provider. This is the base class for all ado drivers.
You can set $db->codePage before connecting.
? depends on database
ADO or OLEDB provider
Windows only
ado_access
B
Microsoft Access/Jet using ADO. Allows DSN-less connections. For best performance, use an OLEDB provider.
Y/N
ADO or OLEDB provider
Windows only
ado_mssql
B
Microsoft SQL Server using ADO. Allows DSN-less connections. For best performance, use an OLEDB provider.
Y/N
ADO or OLEDB provider
Windows only
db2
C
Uses PHP's db2-specific extension for better performance.
Y/N
DB2 CLI/ODBC interface
Unix and Windows. Requires IBM DB2 Universal Database client.
odbc_db2
C
Connects to DB2 using generic ODBC extension.
Y/N
DB2 CLI/ODBC interface
Unix and Windows. Unix install hints. I have had reports that the $host and $database params have to be reversed in Connect() when using the CLI interface.
vfp
A
Microsoft Visual FoxPro. You need to create an ODBC DSN.
Y/N
ODBC
Windows only
fbsql
C
FrontBase.
Y
?
Unix and Windows
ibase
B
Interbase 6 or earlier. Some users report you might need to use this $db->PConnect('localhost:c:/ibase/employee.gdb', "sysdba", "masterkey") to connect. Lacks Affected_Rows currently.
You can set $db->role, $db->dialect, $db->buffers and $db->charSet before connecting.
Y/N
Interbase client
Unix and Windows
firebird
B
Firebird version of interbase.
Y/N
Interbase client
Unix and Windows
borland_ibase
C
Borland version of Interbase 6.5 or later. Very sad that the forks differ.
Y/N
Interbase client
Unix and Windows
informix
C
Generic informix driver. Use this if you are using Informix 7.3 or later.
Y/N
Informix client
Unix and Windows
informix72
C
Informix databases before Informix 7.3 that do no support SELECT FIRST.
Y/N
Informix client
Unix and Windows
ldap
C
LDAP driver. See this example for usage information.
LDAP extension
?
mssql
A
Microsoft SQL Server 7 and later. Works with Microsoft SQL Server 2000 also. Note that date formating is problematic with this driver. For example, the PHP mssql extension does not return the seconds for datetime!
Portable mssql driver. Identical to above mssql driver, except that '||', the concatenation operator, is converted to '+'. Useful for porting scripts from most other sql variants that use ||.
MySQL without transaction support. You can also set $db->clientFlags before connecting.
Y
MySQL client
Unix and Windows
mysqli
B
Supports the newer PHP5 mysql api.
Y
MySQL 4.1+ client
Unix and Windows
mysqlt or maxsql
A
MySQL with transaction support. We recommend using || as the concat operator for best portability. This can be done by running MySQL using: mysqld --ansi or mysqld --sql-mode=PIPES_AS_CONCAT
Y/N
MySQL client
Unix and Windows
oci8
A
Oracle 8/9. Has more functionality than oracle driver (eg. Affected_Rows). You might have to putenv('ORACLE_HOME=...') before Connect/PConnect.
There are 2 ways of connecting - with server IP and service name: PConnect('serverip:1521','scott','tiger','service') or using an entry in TNSNAMES.ORA or ONAMES or HOSTNAMES: PConnect(false, 'scott', 'tiger', $oraname).
Since 2.31, we support Oracle REF cursor variables directly (see ExecuteCursor).
Y/N
Oracle client
Unix and Windows
oci805
C
Supports reduced Oracle functionality for Oracle 8.0.5. SelectLimit is not as efficient as in the oci8 or oci8po drivers.
Y/N
Oracle client
Unix and Windows
oci8po
A
Oracle 8/9 portable driver. This is nearly identical with the oci8 driver except (a) bind variables in Prepare() use the ? convention, instead of :bindvar, (b) field names use the more common PHP convention of lowercase names.
Use this driver if porting from other databases is important. Otherwise the oci8 driver offers better performance.
Y/N
Oracle client
Unix and Windows
odbc
A
Generic ODBC, not tuned for specific databases. To connect, use PConnect('DSN','user','pwd'). This is the base class for all odbc derived drivers.
Generic odbtp driver. Odbtp is a software for accessing Windows ODBC data sources from other operating systems.
Y/N
odbtp
Unix and Windows
odbtp_unicode
C
Odtbp with unicode support
Y/N
odbtp
Unix and Windows
oracle
C
Implements old Oracle 7 client API. Use oci8 driver if possible for better performance.
Y/N
Oracle client
Unix and Windows
netezza
C
Netezza driver. Netezza is based on postgres code-base.
Y
?
?
pdo
C
Generic PDO driver for PHP5.
Y
PDO extension and database specific drivers
Unix and Windows.
postgres
A
Generic PostgreSQL driver. Currently identical to postgres7 driver.
Y
PostgreSQL client
Unix and Windows.
postgres64
A
For PostgreSQL 6.4 and earlier which does not support LIMIT internally.
Y
PostgreSQL client
Unix and Windows.
postgres7
A
PostgreSQL which supports LIMIT and other version 7 functionality.
Y
PostgreSQL client
Unix and Windows.
postgres8
A
Currently identical to postgres7
Y
PostgreSQL client
Unix and Windows.
sapdb
C
SAP DB. Should work reliably as based on ODBC driver.
Y/N
SAP ODBC client
?
sqlanywhere
C
Sybase SQL Anywhere. Should work reliably as based on ODBC driver.
Y/N
SQL Anywhere ODBC client
?
sqlite
B
SQLite.
Y
-
Unix and Windows.
sqlitepo
B
Portable SQLite driver. This is because assoc mode does not work like other drivers in sqlite. Namely, when selecting (joining) multiple tables, the table names are included in the assoc keys in the "sqlite" driver.
In "sqlitepo" driver, the table names are stripped from the returned column names. When this results in a conflict, the first field get preference.
Y
-
Unix and Windows.
sybase
C
Sybase.
Y/N
Sybase client
Unix and Windows.
The "Tested" column indicates how extensively the code has been tested and used. A = well tested and used by many people B = tested and usable, but some features might not be implemented C = user contributed or experimental driver. Might not fully support all of the latest features of ADOdb.
The column "RecordCount() usable" indicates whether RecordCount() return the number of rows, or returns -1 when a SELECT statement is executed. If this column displays Y/N then the RecordCount() is emulated when the global variable $ADODB_COUNTRECS=true, which is the default. Note that for large recordsets, it might be better to disable RecordCount() emulation because substantial amounts of memory are required to cache the recordset for counting. This variable is checked every time a query is executed, so you can selectively choose which recordsets to count.
ถ้าจะทดสอบ ลองติดตั้ง XAMPP ดู มันสามารถเชื่อมต่อกับ ADO ได้ทันทีโดยไม่ต้องการ libraly เพิ่มเติมครับ (แถมมีตัวอย่างมาให้ด้วย)
ถ้าไม่ได้ จะได้ไม่ต้องเสียเวลา ทำต่อครับ
Databases Supported
The name below is the value you pass to NewADOConnection($name) to create a connection object for that database.Generic ADO, not tuned for specific databases. Allows DSN-less connections. For best performance, use an OLEDB provider. This is the base class for all ado drivers.
You can set $db->codePage before connecting.
Unix and Windows. Requires IBM DB2 Universal Database client.
Unix and Windows. Unix install hints. I have had reports that the $host and $database params have to be reversed in Connect() when using the CLI interface.
Unix and Windows
$db->PConnect('localhost:c:/ibase/employee.gdb', "sysdba", "masterkey") to connect. Lacks Affected_Rows currently.
You can set $db->role, $db->dialect, $db->buffers and $db->charSet before connecting.
Microsoft SQL Server 7 and later. Works with Microsoft SQL Server 2000 also. Note that date formating is problematic with this driver. For example, the PHP mssql extension does not return the seconds for datetime!
Unix and Windows.
Unix install howto and another one.
Portable mssql driver. Identical to above mssql driver, except that '||', the concatenation operator, is converted to '+'. Useful for porting scripts from most other sql variants that use ||.
Unix and Windows.
Unix install howto.
MySQL with transaction support. We recommend using || as the concat operator for best portability. This can be done by running MySQL using:
mysqld --ansi or mysqld --sql-mode=PIPES_AS_CONCAT
There are 2 ways of connecting - with server IP and service name:
PConnect('serverip:1521','scott','tiger','service')
or using an entry in TNSNAMES.ORA or ONAMES or HOSTNAMES:
PConnect(false, 'scott', 'tiger', $oraname).
Since 2.31, we support Oracle REF cursor variables directly (see ExecuteCursor).
Use this driver if porting from other databases is important. Otherwise the oci8 driver offers better performance.
PConnect('DSN','user','pwd'). This is the base class for all odbc derived drivers.
?
?
Unix and Windows.
In "sqlitepo" driver, the table names are stripped from the returned column names. When this results in a conflict, the first field get preference.
Unix and Windows.
Unix and Windows.
The "Tested" column indicates how extensively the code has been tested and used.
A = well tested and used by many people
B = tested and usable, but some features might not be implemented
C = user contributed or experimental driver. Might not fully support all of the latest features of ADOdb.
The column "RecordCount() usable" indicates whether RecordCount() return the number of rows, or returns -1 when a SELECT statement is executed. If this column displays Y/N then the RecordCount() is emulated when the global variable $ADODB_COUNTRECS=true, which is the default. Note that for large recordsets, it might be better to disable RecordCount() emulation because substantial amounts of memory are required to cache the recordset for counting. This variable is checked every time a query is executed, so you can selectively choose which recordsets to count.