PHP PDO vs normal mysql_connect

前端 未结 12 1000
盖世英雄少女心
盖世英雄少女心 2020-11-27 12:15

Should I use php PDO or normal mysql_connect to execute database queries in PHP?

Which one is faster?

One of the big benefits of PDO is that the interface is

12条回答
  •  醉话见心
    2020-11-27 12:42

    • With PDO you can uses binded params and that will prevent most sql injection attacks.
    • You can gain more speed using PDO prepared statements.
    • standard interface to all db backends
    • There are a bunch of useful methods (like the fetch* family)

提交回复
热议问题