ThiefMaster
ThiefMaster

Reputation: 318518

Does PDO always use emulated prepared statements by default?

PDO has the option PDO::ATTR_EMULATE_PREPARES which controls if prepared statements should be emulated only if not supported by the DB or always. However, it does not mention if it always emulates them by default or not.

Usually one would assume that emulation is only used if necessary but since it's PHP nothing can be assumed just because it's sane...

Upvotes: 10

Views: 4351

Answers (1)

Jon
Jon

Reputation: 437386

Depends on the database driver. They are always emulated by default for MySql (although of course you can turn the option off manually); in Postgres the proper default setting is detected dynamically.

Upvotes: 17

Related Questions