Jump to content

MySQL -> MySQLi or -> PDO


 Share

Recommended Posts

I have a large app that I need to change over.  At first I was thinking MySQLi, but now I'm thinking PDO.  PHP has been evolving into a real programming language.  I'm starting to think that MySQLi has been the stepping stone to OOP database access, and PDO with OOP and its universal database access methods as the destination to implement a single code base for all DBMS access, and MySQLi being discouraged.  Why would you want to change code to change a database, and why as a developer would you want to remain proficient in multiple code bases to access data?  I haven't worked with PDO in PHP.  Can anyone think of a reason why I wouldn't want to go PDO?

Link to comment
Share on other sites

PDO is the standard because it supports basically every database system. Most people prefer its API over mysqli's but the differences are meaningless if you add your own abstraction on top of it.

mysqli is dedicated to MySQL and can offer better support for MySQL features. I wouldn't say it's "discouraged", rather that people encourage PDO over it.

Almost nobody changes database systems after using one for a while. When they do, PDO has the advantage that you can switch drivers easily, but it won't help them audit all their SQL queries for compatibility.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.