2

I'm using mySQL database and found out that using Prepared statements offer lots of benefits. However by browsing Stackoverflow I noticed that every expert encourages to use PDO, but no one talks about MySQLi. As far I have understood, PDO supports multiple databases, if thats not the concern, why PDO is preferred over mySQLi? Thanks

Dharman
  • 30,962
  • 25
  • 85
  • 135
veeje
  • 21
  • 1
  • also see: http://stackoverflow.com/questions/13569/mysqli-or-pdo-what-are-the-pros-and-cons – kontur Apr 16 '12 at 07:14

2 Answers2

1

PDO is more mature. It offers more features and is easier to use. It has fewer bugs. The choice has nothing to do with the number of drivers supported by PDO; you would need to rewrite your SQL anyway if you decided to change the RDBMS.

PDO is simply a much better extension for communication with the database.

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

PDO is interface for accessing databases, so you can use various drivers. This mechanism gives you abstraction, so it's preferrable.

miholeus
  • 1,537
  • 1
  • 9
  • 8