Ansego Posted March 28, 2014 Share Posted March 28, 2014 I've always used MySQL / MySQLi and never got into PDO, but as I read the posts I am seeing more and more PDO being promoted, is it better? what are the benefits? what's your thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/287357-what-is-your-prefered-pdo-and-mysqli/ Share on other sites More sharing options...
Ansego Posted March 28, 2014 Author Share Posted March 28, 2014 Found this: http://code.tutsplus.com/tutorials/pdo-vs-mysqli-which-should-you-use--net-24059 Quote Link to comment https://forums.phpfreaks.com/topic/287357-what-is-your-prefered-pdo-and-mysqli/#findComment-1474256 Share on other sites More sharing options...
EffakT Posted March 28, 2014 Share Posted March 28, 2014 I used to always use MySQL, then moved to MySQLi and used that for everything, until I started learning OOP, in which I used PDO. Now, I only use PDO (mainly because it is required for my course). Quote Link to comment https://forums.phpfreaks.com/topic/287357-what-is-your-prefered-pdo-and-mysqli/#findComment-1474262 Share on other sites More sharing options...
Clarkey Posted June 2, 2014 Share Posted June 2, 2014 PDO is great because it add an abstraction to the database, regardless of the database server type. For instance, if you use mysqli functions throughout your program, and then somebody else deploys the program but they are using postgres database server, then they would have to change every single function that interacts with a database for it to work. But, with PDO, they can just change one variable, and ta daaa! Quote Link to comment https://forums.phpfreaks.com/topic/287357-what-is-your-prefered-pdo-and-mysqli/#findComment-1481604 Share on other sites More sharing options...
trq Posted June 2, 2014 Share Posted June 2, 2014 PDO is great because it add an abstraction to the database, regardless of the database server type. For instance, if you use mysqli functions throughout your program, and then somebody else deploys the program but they are using postgres database server, then they would have to change every single function that interacts with a database for it to work. But, with PDO, they can just change one variable, and ta daaa! PDO is not a database abstraction. It provides you the same API across databases, but it does nothing to protected you against differences in syntax between those systems. For that you would need to use something like Doctrine's DBAL on top of PDO. Quote Link to comment https://forums.phpfreaks.com/topic/287357-what-is-your-prefered-pdo-and-mysqli/#findComment-1481605 Share on other sites More sharing options...
sKunKbad Posted June 16, 2014 Share Posted June 16, 2014 I like PDO because of the named placeholders, but I use Doctrine DBAL, which has some bonuses over plain PDO. DBAL's documation is nice. Check out DBAL's introduction: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/introduction.html Quote Link to comment https://forums.phpfreaks.com/topic/287357-what-is-your-prefered-pdo-and-mysqli/#findComment-1482746 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.