+ 12

mysqli vs PDO

What's the main difference between these two other than methods and syntax.

31st Mar 2018, 3:16 PM
Toni Isotalo
Toni Isotalo - avatar
4 Answers
+ 8
Ultimately, PDO wins this battle with ease. With support for twelve different database drivers (eighteen different databases!) and named parameters, we can ignore the small performance loss, and get used to its API. From a security standpoint, both of them are safe as long as the developer uses them the way they are supposed to be used (read: prepared statements). for more: https://code.tutsplus.com/tutorials/pdo-vs-mysqli-which-should-you-use--net-24059
31st Mar 2018, 7:41 PM
Baraa AB
Baraa AB - avatar
+ 5
PDO is much better than MYSQLI, because, in theory, you can use the database of your choice, i.e. postgress, sql server, etc.
31st Mar 2018, 5:35 PM
⏩▶Clau◀âȘ
⏩▶Clau◀âȘ - avatar
+ 4
And I say 'in theory', because always are pros and cons of using a specific driver for a Database
31st Mar 2018, 5:39 PM
⏩▶Clau◀âȘ
⏩▶Clau◀âȘ - avatar
+ 1
>> Prepared statements or PDO are better. They are more secure way to pass queries to DB. you will understand it once you learn how Prepared statements/PDO works.
3rd Apr 2018, 10:08 PM
Mr.Cool
Mr.Cool - avatar