IT_Architect Posted October 23, 2021 Share Posted October 23, 2021 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? Quote Link to comment https://forums.phpfreaks.com/topic/314093-mysql-mysqli-or-pdo/ Share on other sites More sharing options...
requinix Posted October 23, 2021 Share Posted October 23, 2021 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. Quote Link to comment https://forums.phpfreaks.com/topic/314093-mysql-mysqli-or-pdo/#findComment-1591367 Share on other sites More sharing options...
IT_Architect Posted October 23, 2021 Author Share Posted October 23, 2021 What are your thoughts on ADOdb? Quote Link to comment https://forums.phpfreaks.com/topic/314093-mysql-mysqli-or-pdo/#findComment-1591369 Share on other sites More sharing options...
IT_Architect Posted October 23, 2021 Author Share Posted October 23, 2021 I guess I'll go with PDO. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/314093-mysql-mysqli-or-pdo/#findComment-1591370 Share on other sites More sharing options...
requinix Posted October 24, 2021 Share Posted October 24, 2021 17 minutes ago, IT_Architect said: What are your thoughts on ADOdb? Sure, if you like the sounds of it. Doctrine is the main one people go for. Quote Link to comment https://forums.phpfreaks.com/topic/314093-mysql-mysqli-or-pdo/#findComment-1591371 Share on other sites More sharing options...
IT_Architect Posted October 24, 2021 Author Share Posted October 24, 2021 Thanks tons! I'll check it out. The reason I brought it up is the original developer has a that code in it too for db access. Quote Link to comment https://forums.phpfreaks.com/topic/314093-mysql-mysqli-or-pdo/#findComment-1591372 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.