Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between ADOdb and PDO in PHP?

Tags:

php

pdo

adodb-php

Both seem to try making it simpler using a database in PHP. Both seem to provide an abstraction over different database types like MySQL, SQLite, etc.

What are the differences between both ADOdb and PDO?

like image 855
openfrog Avatar asked Dec 21 '09 22:12

openfrog


People also ask

What is PDO used for in PHP?

PDO is an acronym for PHP Data Objects. PDO is a lean, consistent way to access databases. This means developers can write portable code much easier.

What is PDO in MySQL?

PDO (PHP Data Objects) is a general database abstraction layer with support for MySQL among many other databases. It provides prepared statements, and significant flexibility in how data is returned.


1 Answers

PDO is standard in PHP as of version 5.1. (It is also available with a PECL extension in PHP 5.0) Most hosting provides will have it enabled. AdoDB is not a standard extension.

Also, I believe the PDO drivers are "PHP-native": they are built on top of the same libraries that PHP itself was built on, and use the same underlying routines for things like memory management. So potentially, PDO is more lightweight than AdoDB.

According to this benchmark, AdoDB is considerably slower than PDO: (fixed link) https://gist.github.com/tony-landis/31483

Of course, you should consider whether this is important enough for your use case to prefer PDO or not.

like image 99
Roland Bouman Avatar answered Oct 08 '22 19:10

Roland Bouman