What are client-side prepared statements?

前端 未结 3 2061
青春惊慌失措
青春惊慌失措 2020-12-16 11:30

Trying to learn something new - specifically trying to choose wether to use MySQLi or PDO for future projects when working with MySQL - I stumbled upon this page which shows

3条回答
  •  别那么骄傲
    2020-12-16 12:11

    Obviously, client-side prepared statements are statements that are prepared by the client, rather than the server.

    PDO is a data-access abstraction layer that supports multiple DBMS interfaces (drivers), some of which support server-side prepared statements (e.g.: MySQL 4.1+), some of which don't (e.g.: MySQL 3).

    In the event where the PDO driver does not support server-side prepared statements, PDO will emulate them on the client-side and use the generic query interface to execute them.

    The reason why MySQLi doesn't support them is simple: MySQLi is a MySQL-specific extension, a RDBMS that indeed supports server-side prepared statements, so there is no reason to emulate them.

提交回复
热议问题