Which one is faster and lighter - mysqli & PDO

后端 未结 3 796
孤独总比滥情好
孤独总比滥情好 2020-12-16 19:34

I am using MySQL with PHP5. I got to know that ancient mysql_* functions are no longer maintained and community has begun the

3条回答
  •  生来不讨喜
    2020-12-16 20:30

    PDO vs. MySQLi: Which Should You Use?

    Both PDO and MySQLi offer an object-oriented API, but MySQLi also offers a procedural API – which makes it easier for newcomers to understand. If you are familiar with the native PHP MySQL driver, you will find migration to the procedural MySQLi interface much easier. On the other hand, once you master PDO, you can use it with any database you desire!

    Summary

    DataBase Support

    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.

    So if you’re still working with MySQLi, maybe it’s time for a change!

    PDO vs. MySQLi: Which Should You Use? - By Dejan Marjanovic

    Hope this helps .

提交回复
热议问题