SlideShare a Scribd company logo
PHP: ADOdb or PDO for DB Access Tom Rogers Northwestern University Department of Anesthesiology
Definition of Database Access A  database abstraction layer  is an  application programming interface  which unifies the communication between a computer application and  databases  such as  PostgreSQL ,  Oracle  or  SQLite .  (Wikipedia) Database abstraction layers reduce the amount of work by providing a consistent API to the developer and hide the database specifics behind this interface as much as possible.  (Wikipedia)
DB Access/Abstraction Libraries/Classes Available PHP Native Libraries Mysql, Msqli Pgsql Pear:DB Pear:MDB2 ADOdb PDO
ADOdb ADOdb  is a database abstraction library for  PHP  and  Python  based on the same concept as Microsoft's  ActiveX Data Objects . It allows developers to write applications in a fairly consistent way regardless of the underlying database storing the information. The advantage is that the database can be changed without re-writing every call to it in the application. (Wikipedia)
PDO PDO provides a  data-access  abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. (PHP Documentation)
DB Connections ADOdb: include('/path/to/adodb.inc.php'); $ado = NewADOConnection('mysql'); $ado->Connect($server, $user, $pwd, $database); ADOdb(dsn): Include('/path/to/adodb.inc.php'); $ado = NewADOConnection(“mysql://$user:$pwd@$server/$database”); PDO: As of PHP 5.1 no extensions needed, although db driver has to be enabled $pdo = new PDO('mysql:host=localhost;dbname=database',”$user”,”$pwd”);
ADOdb: SQL Query and Iteration $sql = “select pk, description from tbl_demo”; ADOdb: (multi-record dataset) foreach($ado->Execute($sql) as $row){ $pk = $row['pk']; $description = $row['description']; ... process code ... } ADOdb: (single record) $row = $ado->GetRow($sql); $pk = $row['pk']; $description = $row['description'];
PDO: SQL Query and Iteration $sql = “select pk, description from tbl_demo”; PDO: foreach($pdo->query($sql) as $row){ $pk = $row['pk']; $description = $row['description']; ... process code ... } As far as I can tell, there is no PDO equivalent to ADOdb's “GetRow” method.
Functions Available ADOdb  (http://phplens.com/adodb/) Connection Management DB Dictionary Library DB-backed Sessions DB Perform. Monitoring Pagination of Record Sets Blob Handling Transactions String, Date Manipulation Error Handling CSV Export PDO  ( http://us2.php.net/pdo ) Connection Management Prepared Statements/Stored Procedures Large Objects (LOB) Transactions Error Handling
Benchmarks http://joseph.randomnetworks.com/archives/2006/04/04/php-database-functions-vs-peardb-vs-adodb/

More Related Content

PDF
PDO Basics - PHPMelb 2014
PPT
PHP - PDO Objects
PDF
Quebec pdo
PPT
Php Data Objects
PPT
Introducing PHP Data Objects
PPT
Php MySql For Beginners
ODP
PHP Data Objects
PDF
Getting Started with PL/Proxy
PDO Basics - PHPMelb 2014
PHP - PDO Objects
Quebec pdo
Php Data Objects
Introducing PHP Data Objects
Php MySql For Beginners
PHP Data Objects
Getting Started with PL/Proxy

What's hot (20)

PPT
PHP and MySQL
PPT
Php classes in mumbai
KEY
Object Relational Mapping in PHP
PPT
Open Source Package PHP & MySQL
ODP
What's new, what's hot in PHP 5.3
PPT
Building Data Mapper PHP5
PDF
Web 10 | PHP with MySQL
PPT
JDBC
PPT
PHP Scripting
PDF
Web 11 | AJAX + JSON + PHP
PDF
PDF
Tips
PDF
PostgreSQL and PL/Java
PPTX
Pdo – php database extension-Phpgurukul
PDF
Web 8 | Introduction to PHP
PDF
Php workshop L04 database
PDF
Php workshop L03 superglobals
PPT
Core Php Component Presentation
PHP and MySQL
Php classes in mumbai
Object Relational Mapping in PHP
Open Source Package PHP & MySQL
What's new, what's hot in PHP 5.3
Building Data Mapper PHP5
Web 10 | PHP with MySQL
JDBC
PHP Scripting
Web 11 | AJAX + JSON + PHP
Tips
PostgreSQL and PL/Java
Pdo – php database extension-Phpgurukul
Web 8 | Introduction to PHP
Php workshop L04 database
Php workshop L03 superglobals
Core Php Component Presentation
Ad

Viewers also liked (20)

PPTX
Non-surgical Facelift - 3D Angel Lift
PPTX
The innovative facelift without surgery
PPT
Pdo presentation eng
PDF
MIcro Lift Threads : Latest Revelation in Face and Body Lift http://spectroni...
PPTX
Anchor data type,cursor data type,array data type
PDF
PPTX
Thread lift treatment
PPT
JDBC Tutorial
PPTX
Security of the database
PPTX
Data base connectivity and flex grid in vb
PDF
Database security issues
PPTX
Database Security
PPTX
Database security
PPTX
Threadlift pp anti aging
PPSX
JDBC: java DataBase connectivity
PPT
3 Tier Architecture
PPTX
Node.JS error handling best practices
PPT
Database Security
PPTX
Database administrator
Non-surgical Facelift - 3D Angel Lift
The innovative facelift without surgery
Pdo presentation eng
MIcro Lift Threads : Latest Revelation in Face and Body Lift http://spectroni...
Anchor data type,cursor data type,array data type
Thread lift treatment
JDBC Tutorial
Security of the database
Data base connectivity and flex grid in vb
Database security issues
Database Security
Database security
Threadlift pp anti aging
JDBC: java DataBase connectivity
3 Tier Architecture
Node.JS error handling best practices
Database Security
Database administrator
Ad

Similar to Adodb Pdo Presentation (20)

PDF
PHP Data Objects
PPT
Quebec pdo
PPT
php databse handling
PPTX
Database Programming
PPT
PI-RDBMS.ppt
PDF
wee
PPT
download presentation
PDF
DPC2007 PHP And Oracle (Kuassi Mensah)
 
PDF
The History of PHPersistence
PPTX
Php talk
PPT
Working with databases in Perl
PDF
PHP & MySQL: PDO x MySQLi
PDF
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
PPT
Dbms & prog lang
PPT
Perl DBI Scripting with the ILS
PDF
The Ring programming language version 1.5.4 book - Part 28 of 185
PPT
Marmagna desai
PPT
Asp #2
PDF
The Ring programming language version 1.3 book - Part 19 of 88
PHP Data Objects
Quebec pdo
php databse handling
Database Programming
PI-RDBMS.ppt
wee
download presentation
DPC2007 PHP And Oracle (Kuassi Mensah)
 
The History of PHPersistence
Php talk
Working with databases in Perl
PHP & MySQL: PDO x MySQLi
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Dbms & prog lang
Perl DBI Scripting with the ILS
The Ring programming language version 1.5.4 book - Part 28 of 185
Marmagna desai
Asp #2
The Ring programming language version 1.3 book - Part 19 of 88

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
PDF
KodekX | Application Modernization Development
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Empathic Computing: Creating Shared Understanding
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
KodekX | Application Modernization Development
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
Dropbox Q2 2025 Financial Results & Investor Presentation
The AUB Centre for AI in Media Proposal.docx
Per capita expenditure prediction using model stacking based on satellite ima...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MYSQL Presentation for SQL database connectivity
Empathic Computing: Creating Shared Understanding
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Adodb Pdo Presentation

  • 1. PHP: ADOdb or PDO for DB Access Tom Rogers Northwestern University Department of Anesthesiology
  • 2. Definition of Database Access A database abstraction layer is an application programming interface which unifies the communication between a computer application and databases such as PostgreSQL , Oracle or SQLite . (Wikipedia) Database abstraction layers reduce the amount of work by providing a consistent API to the developer and hide the database specifics behind this interface as much as possible. (Wikipedia)
  • 3. DB Access/Abstraction Libraries/Classes Available PHP Native Libraries Mysql, Msqli Pgsql Pear:DB Pear:MDB2 ADOdb PDO
  • 4. ADOdb ADOdb is a database abstraction library for PHP and Python based on the same concept as Microsoft's ActiveX Data Objects . It allows developers to write applications in a fairly consistent way regardless of the underlying database storing the information. The advantage is that the database can be changed without re-writing every call to it in the application. (Wikipedia)
  • 5. PDO PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. (PHP Documentation)
  • 6. DB Connections ADOdb: include('/path/to/adodb.inc.php'); $ado = NewADOConnection('mysql'); $ado->Connect($server, $user, $pwd, $database); ADOdb(dsn): Include('/path/to/adodb.inc.php'); $ado = NewADOConnection(“mysql://$user:$pwd@$server/$database”); PDO: As of PHP 5.1 no extensions needed, although db driver has to be enabled $pdo = new PDO('mysql:host=localhost;dbname=database',”$user”,”$pwd”);
  • 7. ADOdb: SQL Query and Iteration $sql = “select pk, description from tbl_demo”; ADOdb: (multi-record dataset) foreach($ado->Execute($sql) as $row){ $pk = $row['pk']; $description = $row['description']; ... process code ... } ADOdb: (single record) $row = $ado->GetRow($sql); $pk = $row['pk']; $description = $row['description'];
  • 8. PDO: SQL Query and Iteration $sql = “select pk, description from tbl_demo”; PDO: foreach($pdo->query($sql) as $row){ $pk = $row['pk']; $description = $row['description']; ... process code ... } As far as I can tell, there is no PDO equivalent to ADOdb's “GetRow” method.
  • 9. Functions Available ADOdb (http://phplens.com/adodb/) Connection Management DB Dictionary Library DB-backed Sessions DB Perform. Monitoring Pagination of Record Sets Blob Handling Transactions String, Date Manipulation Error Handling CSV Export PDO ( http://us2.php.net/pdo ) Connection Management Prepared Statements/Stored Procedures Large Objects (LOB) Transactions Error Handling