ADOdb is a database abstraction library for PHP
It currently supports an amazing number of databases, thanks to the wonderful ADOdb community: MySQL, PostgreSQL, Interbase, Firebird, Informix, Oracle, MS SQL, Foxpro, Access, ADO, Sybase, FrontBase, DB2, SAP DB, SQLite, Netezza, LDAP, and generic ODBC, ODBTP. The Sybase, Informix, FrontBase and PostgreSQL, Netezza, LDAP, ODBTP drivers are community contributions. Here is the complete list of drivers.
Many popular web applications such as ACID, Zikula/PostNuke, phpWiki, Mambo, PHP GACL, TikiWiki, eGroupWare and phpLens App Server are using ADOdb as their database abstraction layer. Some reasons why ADOdb is popular include:
PHP Code Samples
Other things you can try include:
# Updating tables $ok = $DB->Execute("update table set col1=? where key=?",array($colval, $key)); # retrieving data shortcuts $val = $DB->GetOne("select col from table where key='John'"); $row = $DB->GetRow("select col from table where key='John'"); $arr = $DB->GetAll("select col from table"); $arr = $DB->GetAssoc("select key,col from table"); # returns associative array $key=>col # Retrieve high speed cached recordsets (cached for 3600 secs)And there are more connection examples showing you how to connect to SQLite, Oracle, PostgreSQL, Microsoft SQL Server, MS Access, LDAP, Interbase/Firebird, etc.
PHP5 SupportADOdb has full PHP5 support, including SPL and exception support. For example, you can do this in PHP5:
$rs = $DB->Execute("select * from table");If you include the following adodb-exceptions.inc.php file, then ADOdb will throw exceptions when an error occurs:
Requirements: PHP 5.0 or later.
Installation: Unpack files into a directory. Try the above sample code, adjusting the connection parameters to suit your database server, and modify the sql to match your tables.
Debugging: Set your connection's debug property, e.g. $DB->debug=true; if you are having problems. It will output lots of useful status and error messages.
Other Docs for PHP version
The documents in this section are maintained (or not, as the case may be) by their respective authors and are therefore potentially out of date or even obsolete.
A couple excellent articles by icarus about ADOdb at MelonFire:
PHP documentation in other languages:
and tutorials in:
Bug reports, feature requests and questions should be filed on Github.
The legacy ADOdb forums are still available, however they are not actively monitored and should only be used as reference.
© 2000-2014 John Lim. All Rights Reserved. Contact: jlim#natsoft.com