Forums | Mahara Community

Developers /
Are we using PHP's PDO for database access?

Kristina Hoeppner's profile picture
Posts: 3670

30 April 2011, 8:07 PM

Hello developers,

In my iMoot presentation on Mahara 1.4 features, a participant asked "What chances the database layer being migrated to PDO?" He provided a link to "Why you should be using PHP's PDO for Database Access." Are we doing that already? If not, is it on the roadmap? If not, what are the reasons?

Thank you.


30 April 2011, 11:05 PM

Hi Kristina,

We are currently using ADODB as our database abstraction layer, not PDO.

While we have considered switching to PDO before, it's a lot of work and at the time we didn't believe it was worth the effort.



anonymous profile picture
Deleted user
Posts: 10

01 May 2011, 2:22 AM

Actually the correct answer here is 'if you want to use PDO then just select the PDO driver in ADOdb' ... Since PDO provides none of the SQL abstraction that is integral to ADOdb, you need a proper abstraction layer anyway, and so need ADOdb anyway - or some other library that has yet to be writen. One of the ways of TESTING the PDO sub-drivers is to use ADOdb and check that things work the same between the native version and the PDO version, and in most cases the speed difference can be noticable. ADOdb converts it's abstract layer to the native layer, introducing a second 'abstract' layer for PDO just adds to the processing.

PDO is the wrong fix for the problem. Most projects that have changed to it THINKING it fixes cross database working find that even what they have is then a lot more difficult to handle. Currently if you need cross database working ADOdb is the benchmark, and with it's own low level accelerator it can be faster than PDO anyway.

Kristina Hoeppner's profile picture
Posts: 3670

02 May 2011, 12:39 AM

Thank you, Francois and Lester, for your answers. I'll link to them in the iMoot forum. If Michael, who asked the question, wants some more information, he can ask here as we clearly have an expert. Smile



4 results